togglify 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/Gemfile +19 -0
- data/Gemfile.lock +78 -0
- data/Guardfile +8 -0
- data/LICENSE.txt +20 -0
- data/README.md +50 -0
- data/Rakefile +49 -0
- data/VERSION +1 -0
- data/benchmark.org +9 -0
- data/lib/tasks/togglify.rake +13 -0
- data/lib/togglify/railtie.rb +13 -0
- data/lib/togglify/storage.rb +47 -0
- data/lib/togglify.rb +45 -0
- data/spec/dummy/.gitignore +15 -0
- data/spec/dummy/.rspec +2 -0
- data/spec/dummy/.togglify +0 -0
- data/spec/dummy/Gemfile +23 -0
- data/spec/dummy/Gemfile.lock +139 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/images/rails.png +0 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/javascripts/welcome.js.coffee +3 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/assets/stylesheets/welcome.css.scss +3 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/controllers/welcome_controller.rb +14 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/welcome_helper.rb +2 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/models/toggle_test.rb +7 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/app/views/welcome/index.html.haml +17 -0
- data/spec/dummy/config/application.rb +62 -0
- data/spec/dummy/config/boot.rb +6 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +8 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/seeds.rb +7 -0
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/dummy/lib/tasks/.gitkeep +0 -0
- data/spec/dummy/log/.gitkeep +0 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/public/robots.txt +5 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/spec/models/toggle_test_spec.rb +23 -0
- data/spec/dummy/spec/spec_helper.rb +37 -0
- data/spec/dummy/test/fixtures/.gitkeep +0 -0
- data/spec/dummy/test/functional/.gitkeep +0 -0
- data/spec/dummy/test/functional/welcome_controller_test.rb +9 -0
- data/spec/dummy/test/integration/.gitkeep +0 -0
- data/spec/dummy/test/performance/browsing_test.rb +12 -0
- data/spec/dummy/test/test_helper.rb +13 -0
- data/spec/dummy/test/unit/.gitkeep +0 -0
- data/spec/dummy/test/unit/helpers/welcome_helper_test.rb +4 -0
- data/spec/dummy/vendor/assets/javascripts/.gitkeep +0 -0
- data/spec/dummy/vendor/assets/stylesheets/.gitkeep +0 -0
- data/spec/dummy/vendor/plugins/.gitkeep +0 -0
- data/spec/lib/togglify/storage_spec.rb +86 -0
- data/spec/lib/togglify_spec.rb +70 -0
- data/spec/spec_helper.rb +30 -0
- data/spec/support/.togglify +0 -0
- data/togglify.gemspec +145 -0
- metadata +290 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
|
7
|
+
TogglifyTestApp::Application.config.secret_token = 'd211da57f9739e743229bbdcd3ba39fdd2c3e6731c50f3b63ab270f228565984a4d8649836c723360e3b5311e80508c032da2e28cea102b748dfa751a3899dde'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
|
|
3
|
+
TogglifyTestApp::Application.config.session_store :cookie_store, key: '_togglify-test-app_session'
|
|
4
|
+
|
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
|
6
|
+
# which shouldn't be used to store highly confidential information
|
|
7
|
+
# (create the session table with "rails generate session_migration")
|
|
8
|
+
# TogglifyTestApp::Application.config.session_store :active_record_store
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
|
2
|
+
#
|
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
|
4
|
+
# is enabled by default.
|
|
5
|
+
|
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
|
8
|
+
wrap_parameters format: [:json]
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
# Disable root element in JSON by default.
|
|
12
|
+
ActiveSupport.on_load(:active_record) do
|
|
13
|
+
self.include_root_in_json = false
|
|
14
|
+
end
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# This file should contain all the record creation needed to seed the database with its default values.
|
|
2
|
+
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
|
3
|
+
#
|
|
4
|
+
# Examples:
|
|
5
|
+
#
|
|
6
|
+
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
|
|
7
|
+
# Mayor.create(name: 'Emanuel', city: cities.first)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The page you were looking for doesn't exist (404)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/404.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>The page you were looking for doesn't exist.</h1>
|
|
23
|
+
<p>You may have mistyped the address or the page may have moved.</p>
|
|
24
|
+
</div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>The change you wanted was rejected (422)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/422.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>The change you wanted was rejected.</h1>
|
|
23
|
+
<p>Maybe you tried to change something you didn't have access to.</p>
|
|
24
|
+
</div>
|
|
25
|
+
</body>
|
|
26
|
+
</html>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
|
5
|
+
<style type="text/css">
|
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
|
7
|
+
div.dialog {
|
|
8
|
+
width: 25em;
|
|
9
|
+
padding: 0 4em;
|
|
10
|
+
margin: 4em auto 0 auto;
|
|
11
|
+
border: 1px solid #ccc;
|
|
12
|
+
border-right-color: #999;
|
|
13
|
+
border-bottom-color: #999;
|
|
14
|
+
}
|
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
|
16
|
+
</style>
|
|
17
|
+
</head>
|
|
18
|
+
|
|
19
|
+
<body>
|
|
20
|
+
<!-- This file lives in public/500.html -->
|
|
21
|
+
<div class="dialog">
|
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
|
23
|
+
</div>
|
|
24
|
+
</body>
|
|
25
|
+
</html>
|
|
File without changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
3
|
+
|
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
|
6
|
+
require 'rails/commands'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe ToggleTest do
|
|
4
|
+
Togglify(:toggle_tests) do
|
|
5
|
+
it "should return true" do
|
|
6
|
+
ToggleTest.is_it_true?(true).should be_true
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
it "should return true" do
|
|
10
|
+
ToggleTest.is_it_true?(false).should be_false
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
context "non togglified spec" do
|
|
15
|
+
before :each do
|
|
16
|
+
Togglify.disable :toggle_tests
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
it "should raise an error if toggle_tests is disabled" do
|
|
20
|
+
-> { ToggleTest.is_it_true?(true) }.should raise_error
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# This file is copied to spec/ when you run 'rails generate rspec:install'
|
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
|
3
|
+
require File.expand_path("../../config/environment", __FILE__)
|
|
4
|
+
require 'rspec/rails'
|
|
5
|
+
require 'rspec/autorun'
|
|
6
|
+
|
|
7
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
8
|
+
# in spec/support/ and its subdirectories.
|
|
9
|
+
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
|
|
10
|
+
|
|
11
|
+
RSpec.configure do |config|
|
|
12
|
+
# ## Mock Framework
|
|
13
|
+
#
|
|
14
|
+
# If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
|
|
15
|
+
#
|
|
16
|
+
# config.mock_with :mocha
|
|
17
|
+
# config.mock_with :flexmock
|
|
18
|
+
# config.mock_with :rr
|
|
19
|
+
|
|
20
|
+
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
|
|
21
|
+
config.fixture_path = "#{::Rails.root}/spec/fixtures"
|
|
22
|
+
|
|
23
|
+
# If you're not using ActiveRecord, or you'd prefer not to run each of your
|
|
24
|
+
# examples within a transaction, remove the following line or assign false
|
|
25
|
+
# instead of true.
|
|
26
|
+
config.use_transactional_fixtures = true
|
|
27
|
+
|
|
28
|
+
# If true, the base class of anonymous controllers will be inferred
|
|
29
|
+
# automatically. This will be the default behavior in future versions of
|
|
30
|
+
# rspec-rails.
|
|
31
|
+
config.infer_base_class_for_anonymous_controllers = false
|
|
32
|
+
|
|
33
|
+
config.before :suite do
|
|
34
|
+
Togglify.enable :toggle_tests
|
|
35
|
+
sleep(2)
|
|
36
|
+
end
|
|
37
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
require 'rails/performance_test_help'
|
|
3
|
+
|
|
4
|
+
class BrowsingTest < ActionDispatch::PerformanceTest
|
|
5
|
+
# Refer to the documentation for all available options
|
|
6
|
+
# self.profile_options = { :runs => 5, :metrics => [:wall_time, :memory]
|
|
7
|
+
# :output => 'tmp/performance', :formats => [:flat] }
|
|
8
|
+
|
|
9
|
+
def test_homepage
|
|
10
|
+
get '/'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
ENV["RAILS_ENV"] = "test"
|
|
2
|
+
require File.expand_path('../../config/environment', __FILE__)
|
|
3
|
+
require 'rails/test_help'
|
|
4
|
+
|
|
5
|
+
class ActiveSupport::TestCase
|
|
6
|
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
|
|
7
|
+
#
|
|
8
|
+
# Note: You'll currently still have to declare fixtures explicitly in integration tests
|
|
9
|
+
# -- they do not yet inherit this setting
|
|
10
|
+
fixtures :all
|
|
11
|
+
|
|
12
|
+
# Add more helper methods to be used by all tests here...
|
|
13
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Togglify::Storage do
|
|
4
|
+
let(:storage) { Togglify::Storage.new }
|
|
5
|
+
let(:path) { Rails.root + ".togglify"}
|
|
6
|
+
|
|
7
|
+
before(:each) do
|
|
8
|
+
FileUtils.rm path if File.exists? path
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
before(:each) do
|
|
12
|
+
Rails.env = "test"
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
it "should be a class" do
|
|
17
|
+
Togglify::Storage.class.should eq Class
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
it "should have a pstore object" do
|
|
21
|
+
storage.pstore.class.should eq PStore
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
context "#write_on" do
|
|
25
|
+
it "should write enabled to the pstore" do
|
|
26
|
+
storage.write_on(:forum).should eq({ id: :forum, test: :enabled })
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
it "should change the toggle to a symbol if string is given" do
|
|
30
|
+
storage.write_on("forum").should eq({ id: :forum, test: :enabled })
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "should add to the exisiting data hash" do
|
|
34
|
+
storage.write_on(:forum)
|
|
35
|
+
Rails.env = "development"
|
|
36
|
+
storage.write_on(:forum).should eq({ id: :forum, test: :enabled, development: :enabled })
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
it "should overwite an existing data hash" do
|
|
40
|
+
storage.write_on(:forum).should eq({ id: :forum, test: :enabled })
|
|
41
|
+
storage.write_off(:forum).should eq({ id: :forum, test: :disabled })
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
context "#write_off" do
|
|
46
|
+
it "should write disabled to the pstore" do
|
|
47
|
+
storage.write_off(:forum).should eq({ id: :forum, test: :disabled })
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it "should change the toggle to a symbol if string is given" do
|
|
51
|
+
storage.write_off("forum").should eq({ id: :forum, test: :disabled })
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
context "#read" do
|
|
56
|
+
it "should read the toggle state from the pstore" do
|
|
57
|
+
storage.write_off :forum
|
|
58
|
+
storage.read(:forum).should eq({ id: :forum, test: :disabled})
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "should change the toggle to sym if string is given" do
|
|
62
|
+
storage.write_off :forum
|
|
63
|
+
storage.read("forum").should eq({ id: :forum, test: :disabled })
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
it "should get all the root objects if no parameters given" do
|
|
67
|
+
storage.write_off(:forum)
|
|
68
|
+
storage.write_off(:blog)
|
|
69
|
+
storage.list.should eq([:forum, :blog])
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
context "#sanitize" do
|
|
74
|
+
it "should change a string to a symble" do
|
|
75
|
+
storage.send(:sanitize, "forum").should eq :forum
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
it "should downcase a string before symbolizing" do
|
|
79
|
+
storage.send(:sanitize, "Forum").should eq :forum
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
it "should downcase and symbolize a class name" do
|
|
83
|
+
storage.send(:sanitize, String).should eq :string
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Togglify do
|
|
4
|
+
let(:path) { Rails.root + "/.togglify" }
|
|
5
|
+
|
|
6
|
+
it "should be a module" do
|
|
7
|
+
Togglify.class.should eq Module
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "should have a file_path class variable" do
|
|
11
|
+
Togglify.file_path = path
|
|
12
|
+
Togglify.file_path.should eq path
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
context "#Togglify" do
|
|
16
|
+
it "should yield if toggle is enabled" do
|
|
17
|
+
Togglify.send(:storage).write_on :forum
|
|
18
|
+
expect { |b| Togglify(:forum, &b) }.to yield_control
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
it "should not yield if toggle is disabled" do
|
|
22
|
+
Togglify.send(:storage).write_off :forum
|
|
23
|
+
expect { |b| Togglify(:forum, &b) }.not_to yield_control
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
context "#enable" do
|
|
28
|
+
it "should enable the toggle" do
|
|
29
|
+
Togglify.enable :forum
|
|
30
|
+
Togglify.enabled?(:forum).should be_true
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it "should disable the toggle" do
|
|
34
|
+
Togglify.disable :forum
|
|
35
|
+
Togglify.enabled?(:forum).should be_false
|
|
36
|
+
end
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
context "#enabled?" do
|
|
40
|
+
it "should be enabled by default" do
|
|
41
|
+
FileUtils.rm path
|
|
42
|
+
Togglify.enabled?(:forum).should be_true
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it "should be true if status is enabled" do
|
|
46
|
+
Togglify.send(:storage).write_on :forum
|
|
47
|
+
Togglify.enabled?(:forum).should be_true
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
it "should be false status is not enabled" do
|
|
51
|
+
Togglify.send(:storage).write_off :forum
|
|
52
|
+
Togglify.enabled?(:forum).should be_false
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
context "#storage" do
|
|
57
|
+
it "should have a storage object" do
|
|
58
|
+
Togglify.send(:storage).class.should eq Togglify::Storage
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
it "should be a private method" do
|
|
62
|
+
-> { Togglify.storage }.should raise_error
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
it "should not allow the object to be changed" do
|
|
66
|
+
-> { Togglify.storage = "Something Else" }.should raise_error
|
|
67
|
+
-> { Togglify.send(:storage=, "Something Else") }.should raise_error
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
data/spec/spec_helper.rb
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'simplecov'
|
|
2
|
+
SimpleCov.start
|
|
3
|
+
|
|
4
|
+
require 'rspec'
|
|
5
|
+
require 'togglify'
|
|
6
|
+
|
|
7
|
+
# Requires supporting files with custom matchers and macros, etc,
|
|
8
|
+
# in ./support/ and its subdirectories.
|
|
9
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
|
10
|
+
|
|
11
|
+
RSpec.configure do |config|
|
|
12
|
+
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# Simulate rails root
|
|
16
|
+
module Rails
|
|
17
|
+
@@env = "test"
|
|
18
|
+
|
|
19
|
+
def self.root
|
|
20
|
+
File.expand_path("../support/", __FILE__)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def self.env
|
|
24
|
+
@@env
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def self.env=(env)
|
|
28
|
+
@@env = env
|
|
29
|
+
end
|
|
30
|
+
end
|
|
Binary file
|
data/togglify.gemspec
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Generated by jeweler
|
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
|
4
|
+
# -*- encoding: utf-8 -*-
|
|
5
|
+
|
|
6
|
+
Gem::Specification.new do |s|
|
|
7
|
+
s.name = "togglify"
|
|
8
|
+
s.version = "0.0.1"
|
|
9
|
+
|
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
11
|
+
s.authors = ["Brady Love"]
|
|
12
|
+
s.date = "2012-10-23"
|
|
13
|
+
s.description = "A Rubygem that allows you to easily enable/disable parts of your ruby code."
|
|
14
|
+
s.email = "love.brady@gmail.com"
|
|
15
|
+
s.extra_rdoc_files = [
|
|
16
|
+
"LICENSE.txt",
|
|
17
|
+
"README.md"
|
|
18
|
+
]
|
|
19
|
+
s.files = [
|
|
20
|
+
".rspec",
|
|
21
|
+
".ruby-version",
|
|
22
|
+
"Gemfile",
|
|
23
|
+
"Gemfile.lock",
|
|
24
|
+
"Guardfile",
|
|
25
|
+
"LICENSE.txt",
|
|
26
|
+
"README.md",
|
|
27
|
+
"Rakefile",
|
|
28
|
+
"VERSION",
|
|
29
|
+
"benchmark.org",
|
|
30
|
+
"lib/tasks/togglify.rake",
|
|
31
|
+
"lib/togglify.rb",
|
|
32
|
+
"lib/togglify/railtie.rb",
|
|
33
|
+
"lib/togglify/storage.rb",
|
|
34
|
+
"spec/dummy/.gitignore",
|
|
35
|
+
"spec/dummy/.rspec",
|
|
36
|
+
"spec/dummy/.togglify",
|
|
37
|
+
"spec/dummy/Gemfile",
|
|
38
|
+
"spec/dummy/Gemfile.lock",
|
|
39
|
+
"spec/dummy/README.rdoc",
|
|
40
|
+
"spec/dummy/Rakefile",
|
|
41
|
+
"spec/dummy/app/assets/images/rails.png",
|
|
42
|
+
"spec/dummy/app/assets/javascripts/application.js",
|
|
43
|
+
"spec/dummy/app/assets/javascripts/welcome.js.coffee",
|
|
44
|
+
"spec/dummy/app/assets/stylesheets/application.css",
|
|
45
|
+
"spec/dummy/app/assets/stylesheets/welcome.css.scss",
|
|
46
|
+
"spec/dummy/app/controllers/application_controller.rb",
|
|
47
|
+
"spec/dummy/app/controllers/welcome_controller.rb",
|
|
48
|
+
"spec/dummy/app/helpers/application_helper.rb",
|
|
49
|
+
"spec/dummy/app/helpers/welcome_helper.rb",
|
|
50
|
+
"spec/dummy/app/mailers/.gitkeep",
|
|
51
|
+
"spec/dummy/app/models/.gitkeep",
|
|
52
|
+
"spec/dummy/app/models/toggle_test.rb",
|
|
53
|
+
"spec/dummy/app/views/layouts/application.html.erb",
|
|
54
|
+
"spec/dummy/app/views/welcome/index.html.haml",
|
|
55
|
+
"spec/dummy/config.ru",
|
|
56
|
+
"spec/dummy/config/application.rb",
|
|
57
|
+
"spec/dummy/config/boot.rb",
|
|
58
|
+
"spec/dummy/config/database.yml",
|
|
59
|
+
"spec/dummy/config/environment.rb",
|
|
60
|
+
"spec/dummy/config/environments/development.rb",
|
|
61
|
+
"spec/dummy/config/environments/production.rb",
|
|
62
|
+
"spec/dummy/config/environments/test.rb",
|
|
63
|
+
"spec/dummy/config/initializers/backtrace_silencers.rb",
|
|
64
|
+
"spec/dummy/config/initializers/inflections.rb",
|
|
65
|
+
"spec/dummy/config/initializers/mime_types.rb",
|
|
66
|
+
"spec/dummy/config/initializers/secret_token.rb",
|
|
67
|
+
"spec/dummy/config/initializers/session_store.rb",
|
|
68
|
+
"spec/dummy/config/initializers/wrap_parameters.rb",
|
|
69
|
+
"spec/dummy/config/locales/en.yml",
|
|
70
|
+
"spec/dummy/config/routes.rb",
|
|
71
|
+
"spec/dummy/db/seeds.rb",
|
|
72
|
+
"spec/dummy/lib/assets/.gitkeep",
|
|
73
|
+
"spec/dummy/lib/tasks/.gitkeep",
|
|
74
|
+
"spec/dummy/log/.gitkeep",
|
|
75
|
+
"spec/dummy/public/404.html",
|
|
76
|
+
"spec/dummy/public/422.html",
|
|
77
|
+
"spec/dummy/public/500.html",
|
|
78
|
+
"spec/dummy/public/favicon.ico",
|
|
79
|
+
"spec/dummy/public/robots.txt",
|
|
80
|
+
"spec/dummy/script/rails",
|
|
81
|
+
"spec/dummy/spec/models/toggle_test_spec.rb",
|
|
82
|
+
"spec/dummy/spec/spec_helper.rb",
|
|
83
|
+
"spec/dummy/test/fixtures/.gitkeep",
|
|
84
|
+
"spec/dummy/test/functional/.gitkeep",
|
|
85
|
+
"spec/dummy/test/functional/welcome_controller_test.rb",
|
|
86
|
+
"spec/dummy/test/integration/.gitkeep",
|
|
87
|
+
"spec/dummy/test/performance/browsing_test.rb",
|
|
88
|
+
"spec/dummy/test/test_helper.rb",
|
|
89
|
+
"spec/dummy/test/unit/.gitkeep",
|
|
90
|
+
"spec/dummy/test/unit/helpers/welcome_helper_test.rb",
|
|
91
|
+
"spec/dummy/vendor/assets/javascripts/.gitkeep",
|
|
92
|
+
"spec/dummy/vendor/assets/stylesheets/.gitkeep",
|
|
93
|
+
"spec/dummy/vendor/plugins/.gitkeep",
|
|
94
|
+
"spec/lib/togglify/storage_spec.rb",
|
|
95
|
+
"spec/lib/togglify_spec.rb",
|
|
96
|
+
"spec/spec_helper.rb",
|
|
97
|
+
"spec/support/.togglify",
|
|
98
|
+
"togglify.gemspec"
|
|
99
|
+
]
|
|
100
|
+
s.homepage = "http://github.com/bradylove/togglify"
|
|
101
|
+
s.licenses = ["MIT"]
|
|
102
|
+
s.require_paths = ["lib"]
|
|
103
|
+
s.rubygems_version = "1.8.24"
|
|
104
|
+
s.summary = "A Rubygem for feature toggling in Rails"
|
|
105
|
+
|
|
106
|
+
if s.respond_to? :specification_version then
|
|
107
|
+
s.specification_version = 3
|
|
108
|
+
|
|
109
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
|
110
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.11.0"])
|
|
111
|
+
s.add_development_dependency(%q<pry-debugger>, [">= 0"])
|
|
112
|
+
s.add_development_dependency(%q<guard-rspec>, [">= 0"])
|
|
113
|
+
s.add_development_dependency(%q<fuubar>, [">= 0"])
|
|
114
|
+
s.add_development_dependency(%q<rb-fsevent>, [">= 0"])
|
|
115
|
+
s.add_development_dependency(%q<rb-inotify>, [">= 0"])
|
|
116
|
+
s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
|
|
117
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.2.1"])
|
|
118
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
|
|
119
|
+
s.add_development_dependency(%q<simplecov>, [">= 0"])
|
|
120
|
+
else
|
|
121
|
+
s.add_dependency(%q<rspec>, ["~> 2.11.0"])
|
|
122
|
+
s.add_dependency(%q<pry-debugger>, [">= 0"])
|
|
123
|
+
s.add_dependency(%q<guard-rspec>, [">= 0"])
|
|
124
|
+
s.add_dependency(%q<fuubar>, [">= 0"])
|
|
125
|
+
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
|
126
|
+
s.add_dependency(%q<rb-inotify>, [">= 0"])
|
|
127
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
|
128
|
+
s.add_dependency(%q<bundler>, ["~> 1.2.1"])
|
|
129
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
|
130
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
|
131
|
+
end
|
|
132
|
+
else
|
|
133
|
+
s.add_dependency(%q<rspec>, ["~> 2.11.0"])
|
|
134
|
+
s.add_dependency(%q<pry-debugger>, [">= 0"])
|
|
135
|
+
s.add_dependency(%q<guard-rspec>, [">= 0"])
|
|
136
|
+
s.add_dependency(%q<fuubar>, [">= 0"])
|
|
137
|
+
s.add_dependency(%q<rb-fsevent>, [">= 0"])
|
|
138
|
+
s.add_dependency(%q<rb-inotify>, [">= 0"])
|
|
139
|
+
s.add_dependency(%q<rdoc>, ["~> 3.12"])
|
|
140
|
+
s.add_dependency(%q<bundler>, ["~> 1.2.1"])
|
|
141
|
+
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
|
142
|
+
s.add_dependency(%q<simplecov>, [">= 0"])
|
|
143
|
+
end
|
|
144
|
+
end
|
|
145
|
+
|