Permalink
Browse files

re-arrange files

  • Loading branch information...
bkaney committed Oct 26, 2011
1 parent 2ac2c4b commit 94238c100290bfce12ceb862407f9a01268b0cb9
View
1 .rvmrc
@@ -0,0 +1 @@
+rvm 1.9.2@binflip --create --verbose
View
@@ -0,0 +1,17 @@
+PATH
+ remote: .
+ specs:
+ binflip (0.0.1)
+ rake (~> 0.9.2)
+
+GEM
+ remote: http://rubygems.org/
+ specs:
+ rake (0.9.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ binflip!
+ rake (~> 0.9.2)
View
@@ -1,16 +1,16 @@
# -*- encoding: utf-8 -*-
Gem::Specification.new do |s|
- s.name = "Binflip"
- s.version = '0.0.0'
+ s.name = "binflip"
+ s.version = '0.0.1'
s.platform = Gem::Platform::RUBY
s.authors = ["Brian Kaney"]
s.email = ["brian@vermonster.com"]
s.homepage = ""
s.summary = %q{Kanban Flipper}
s.description = %q{Kanban Flipper for Rails, support for cucumber}
- s.add_dependency 'rake', '0.9.2'
+ s.add_dependency 'rake', '~> 0.9.2'
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
View
@@ -1,4 +1,4 @@
-# in config/bin_flip.rb
+# in config/binflip.rb
#
# $kanban = BinFlip.new
#
@@ -7,21 +7,23 @@
# if $kanban.active?('235_feature_x')
# # ...
# end
-#
+
module Binflip
- BINS = %w(dev approval sqa production)
+ BINS = %w(devopment approval sqa production)
DEPLOYED_BIN = 'production'
- CONFIG_FILE = File.join(Rails.root, 'config', 'kanban.yml')
-
class FeatureUnknown < Exception; end;
class BinUnknown < Exception; end;
-
+
+ def self.config_file
+ raise NotImplementedError
+ end
+
def self.current_bin
raise NotImplementedError
end
-
+
class << self
def active?(feature)
@@ -31,17 +33,17 @@ def active?(feature)
features_per_bin(current_bin)[feature.to_s]
end
-
+
def features
- @features ||= YAML.load_file(FEATURE_CONFIG_FILE)
+ @features ||= YAML.load_file(self.config_file)
end
-
+
def features_per_bin(bin)
- unless features.keys.include?(bin)
+ unless features.keys.include?(bin.to_s)
raise BinUnknown, "It looks like you don't have a bin '#{bin}'"
end
-
- features[bin] || {}
+
+ features[bin.to_s] || {}
end
def features=(features)
@@ -53,4 +55,4 @@ def features=(features)
end
require 'core_ext/rake'
-require 'lib/vendor/rails' if defined?(Rails)
+require 'binflip/rails' if defined?(Rails)
@@ -1,11 +1,11 @@
require 'binflip'
-module BinFlip
+module Binflip
module Cucumber
def self.toggle_bin!(current_bin, scenario)
# Toggle bin
- BinFlip.module_eval <<-RUBY
+ Binflip.module_eval <<-RUBY
def self.current_bin
return '#{kanban_bin}'
end
View
@@ -0,0 +1 @@
+require 'rails/active_support' if defined?(ActiveSupport::Base)
File renamed without changes.
View
@@ -1 +0,0 @@
-require 'lib/vendor/rails/active_support' if defined?(ActiveSupport::Base)

0 comments on commit 94238c1

Please sign in to comment.