confit_rails 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/LICENSE +20 -0
  2. data/README.md +56 -0
  3. data/lib/confit/version.rb +1 -1
  4. metadata +3 -2
  5. data/MIT-LICENSE +0 -20
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2013 temkin
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # Confit (Configure It)
2
+ simple gem for configure your rails app
3
+
4
+ ## Installation
5
+
6
+ ### Add to your Gemfile
7
+
8
+ gem 'confit_rails'
9
+
10
+ ### Bundle it
11
+
12
+ Run <tt>bundle install</tt>
13
+
14
+ ### Add migrations to your application
15
+
16
+ Run <tt>rails generate confit</tt>
17
+
18
+ ### Migrate
19
+ Run <tt>rake db:migrate</tt>
20
+
21
+ ## Usage
22
+
23
+ Just simple in you controller or views call
24
+ <pre>Confit::Confit.get('some_your_pretty_setting_name', 'default_value', 'some_description')</pre>
25
+ it will be get value of your setting stored in database named `some_your_pretty_setting_name` or create it with default value.
26
+
27
+ If your setting name starts with:
28
+ <pre>
29
+ bool_<some_name>
30
+ choose_<some_name>
31
+ </pre>
32
+ it will result you as folows:
33
+ <pre>
34
+ Confit::Confit.get('bool_some_name', true)
35
+ => true
36
+
37
+
38
+ Confit::Confit.get('choose_some_name', 'foo|bar|baz')
39
+ => ["foo", "bar", "baz"]
40
+ OR
41
+ Confit::Confit.get('choose_some_name', ['foo', 'bar', 'baz'])
42
+ => ["foo", "bar", "baz"]
43
+ OR
44
+ Confit::Confit.get('choose_some_name', {:foo=>:foo, :bar=>:bar, :baz=>:baz})
45
+ => ["foo", "bar", "baz"]
46
+ </pre>
47
+
48
+ ## TODO
49
+
50
+ Write tests
51
+ Add default modules for AA
52
+
53
+
54
+ # Contribute
55
+
56
+ feel free to contribute
@@ -1,3 +1,3 @@
1
1
  module Confit
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: confit_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -56,9 +56,10 @@ files:
56
56
  - lib/generators/confit/confit_generator.rb
57
57
  - lib/generators/confit/templates/migration.rb
58
58
  - lib/confit.rb
59
- - MIT-LICENSE
60
59
  - Rakefile
61
60
  - README.rdoc
61
+ - LICENSE
62
+ - README.md
62
63
  - test/integration/navigation_test.rb
63
64
  - test/test_helper.rb
64
65
  - test/confit_test.rb
data/MIT-LICENSE DELETED
@@ -1,20 +0,0 @@
1
- Copyright 2013 YOURNAME
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
10
-
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
13
-
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.