Skip to content
Browse files

Remove ActiveSupport dependencies

  • Loading branch information...
1 parent 286c33f commit d442d9e7d5536ee310f3c0e3b4798269935d5b4a @kmayer kmayer committed
Showing with 19 additions and 17 deletions.
  1. +0 −1 heroku_san.gemspec
  2. +8 −1 lib/heroku_san.rb
  3. +2 −5 lib/heroku_san/project.rb
  4. +6 −7 lib/heroku_san/stage.rb
  5. +3 −3 spec/heroku_san/stage_spec.rb
View
1 heroku_san.gemspec
@@ -29,7 +29,6 @@ Gem::Specification.new do |s|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<heroku-api>, ['>= 0.1.2'])
s.add_runtime_dependency(%q<rake>)
- s.add_runtime_dependency('activesupport')
s.add_development_dependency(%q<rails>, ['>= 2'])
s.add_development_dependency(%q<rspec>)
s.add_development_dependency(%q<aruba>)
View
9 lib/heroku_san.rb
@@ -6,7 +6,14 @@
require 'heroku_san/deploy/sinatra'
module HerokuSan
- mattr_accessor :project
+ class << self
+ def project
+ @project
+ end
+ def project=(project)
+ @project = project
+ end
+ end
class NoApps < StandardError; end
class MissingApp < StandardError; end
class Deprecated < StandardError; end
View
7 lib/heroku_san/project.rb
@@ -1,6 +1,3 @@
-require 'active_support/core_ext/string'
-require 'active_support/core_ext/hash/slice'
-
module HerokuSan
class Project
attr_reader :config_file
@@ -14,7 +11,7 @@ def initialize(config_file, options = {})
config = parse(@config_file)
config.each do |stage, settings|
# TODO: Push this eval later (j.i.t.)
- @app_settings[stage] = HerokuSan::Stage.new(stage, settings.merge(options.slice(:deploy)))
+ @app_settings[stage] = HerokuSan::Stage.new(stage, settings.merge('deploy' => (options[:deploy]||options['deploy'])))
end
end
@@ -45,7 +42,7 @@ def <<(*app)
end
def apps
- if @apps.present?
+ if @apps && !@apps.empty?
@apps
else
@apps = if all.size == 1
View
13 lib/heroku_san/stage.rb
@@ -1,8 +1,5 @@
require 'heroku-api'
require 'json'
-require 'active_support/core_ext/object/blank'
-require 'active_support/core_ext/hash/keys'
-require 'active_support/core_ext/hash/slice'
MOCK = false unless defined?(MOCK)
@@ -16,7 +13,7 @@ def initialize(stage, options = {})
'deploy' => HerokuSan::Deploy::Rails
}
@name = stage
- @options = default_options.merge(options.stringify_keys)
+ @options = default_options.merge(options)
end
def heroku
@@ -85,8 +82,10 @@ def maintenance(action = nil)
end
def create
- params = @options.slice('app', 'stack').stringify_keys
- params['name'] = params.delete('app')
+ params = {
+ 'name' => @options['app'],
+ 'stack' => @options['stack']
+ }
response = heroku.post_app(params)
response.body['name']
end
@@ -104,7 +103,7 @@ def long_config
end
def push_config(options = nil)
- params = (options || config).stringify_keys
+ params = (options || config)
heroku.put_config_vars(app, params).body
end
View
6 spec/heroku_san/stage_spec.rb
@@ -219,15 +219,15 @@ def deploy; end
describe "#push_config" do
it "updates the configuration settings on Heroku" do
- subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {:FOO => 'bar', :DOG => 'emu'}})
+ subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {'FOO' => 'bar', 'DOG' => 'emu'}})
with_app(subject, 'name' => subject.app) do |app_data|
subject.push_config.should == STOCK_CONFIG.merge('FOO' => 'bar', 'DOG' => 'emu')
end
end
it "pushes the options hash" do
- subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {:FOO => 'bar', :DOG => 'emu'}})
+ subject = HerokuSan::Stage.new('test', {"app" => "awesomeapp", "config" => {'FOO' => 'bar', 'DOG' => 'emu'}})
with_app(subject, 'name' => subject.app) do |app_data|
- subject.push_config(:RACK_ENV => 'magic').should == STOCK_CONFIG.merge('RACK_ENV' => 'magic')
+ subject.push_config('RACK_ENV' => 'magic').should == STOCK_CONFIG.merge('RACK_ENV' => 'magic')
end
end
end

0 comments on commit d442d9e

Please sign in to comment.
Something went wrong with that request. Please try again.