racym 0.0.4 → 0.0.5
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.
- checksums.yaml +5 -5
- data/.gitignore +0 -1
- data/.ruby-version +1 -1
- data/.travis.yml +7 -4
- data/CHANGELOG.markdown +6 -0
- data/Gemfile +2 -0
- data/LICENSE.txt +14 -19
- data/README.md +100 -13
- data/lib/racym/version.rb +1 -1
- data/racym.gemspec +4 -4
- metadata +11 -14
- data/spec/lib/racym_spec.rb +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7526accebf5f139e4e76a413da4d63242ad5e3ce1bb1d4f4ecf8e019164e1cd4
|
4
|
+
data.tar.gz: 9bc5ebdb2a093650107486e5740b148bd1076d45f661301d17bcc43af074f250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4357233a9edbcc9252e441eff57ba2fdd6ed1d3200de84ef86e2a1a4a4b87dcd1eb9b6186d94bb15f3c4b2f4660741bafc4f5c9b7e1f68956a692bacb234d6a
|
7
|
+
data.tar.gz: 15afa8c87a711383a93dfc57e535a5051a0989f0fad5590262331f4363a506f87829fe9057953feb8d47b516b558174791a16ee6de2fb16b1bef03457e825501
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.3
|
data/.travis.yml
CHANGED
data/CHANGELOG.markdown
ADDED
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,22 +1,17 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
|
+
Copyright (c) 2019 User Testing, Inc.
|
2
3
|
|
3
|
-
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
|
5
|
+
and associated documentation files (the "Software"), to deal in the Software without restriction,
|
6
|
+
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
7
|
+
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
8
|
+
subject to the following conditions:
|
4
9
|
|
5
|
-
|
6
|
-
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
11
|
-
the following conditions:
|
10
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial
|
11
|
+
portions of the Software.
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
14
|
+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
15
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
16
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
17
|
+
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,35 +1,122 @@
|
|
1
|
-
|
1
|
+
# racym
|
2
2
|
|
3
|
-
[](https://travis-ci.org/usertesting/racym) [](https://coveralls.io/github/usertesting/racym) [](https://codeclimate.com/github/usertesting/racym)
|
6
4
|
|
7
5
|
Rails Application Configuration for Yield Main (RACYM)
|
8
6
|
|
9
|
-
|
7
|
+
racym is used as a shortcut to rails configuration.
|
10
8
|
|
11
9
|
## Installation
|
12
10
|
|
13
11
|
Add this line to your application's Gemfile:
|
14
12
|
|
15
|
-
|
13
|
+
```ruby
|
14
|
+
gem "racym"
|
15
|
+
```
|
16
16
|
|
17
17
|
And then execute:
|
18
18
|
|
19
|
-
|
19
|
+
```ruby
|
20
|
+
$ bundle install
|
21
|
+
```
|
22
|
+
|
23
|
+
## Usage
|
20
24
|
|
21
|
-
|
25
|
+
### Setting config values
|
22
26
|
|
23
|
-
|
27
|
+
In your `config/application.rb` add config settings:
|
24
28
|
|
25
|
-
|
29
|
+
```ruby
|
30
|
+
module MyApp
|
31
|
+
class Application < Rails::Application
|
32
|
+
|
33
|
+
...
|
34
|
+
|
35
|
+
# Add a custom config setting here:
|
36
|
+
config.foo = "bar"
|
37
|
+
|
38
|
+
# Or a proc:
|
39
|
+
config.biz = -> { DateTime.current }
|
40
|
+
```
|
41
|
+
|
42
|
+
### Getting config values
|
43
|
+
|
44
|
+
From anywhere in your Rails application (controllers/helpers/views - should be available anywhere!)
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
puts racym(:foo)
|
48
|
+
# => "bar"
|
49
|
+
|
50
|
+
puts racym(:biz)
|
51
|
+
# => Wed, 02 Oct 2019 11:13:20 -0700
|
52
|
+
|
53
|
+
# ten minutes later:
|
54
|
+
puts racym(:biz)
|
55
|
+
# => Wed, 02 Oct 2019 11:23:20 -0700
|
56
|
+
```
|
57
|
+
|
58
|
+
### Multilevel key/values
|
59
|
+
|
60
|
+
#### Setting:
|
61
|
+
|
62
|
+
```ruby
|
63
|
+
module MyApp
|
64
|
+
class Application < Rails::Application
|
65
|
+
|
66
|
+
...
|
67
|
+
|
68
|
+
config.foo.username = "BAR"
|
69
|
+
config.foo.password = "BIZ"
|
70
|
+
```
|
71
|
+
|
72
|
+
#### Getting:
|
73
|
+
|
74
|
+
```ruby
|
75
|
+
puts racym(:foo, :username)
|
76
|
+
# => "BAR"
|
77
|
+
|
78
|
+
puts racym(:foo, :password)
|
79
|
+
# => "BIZ"
|
80
|
+
```
|
81
|
+
|
82
|
+
### Testing
|
83
|
+
|
84
|
+
There's some convenient methods you can use to test code using racym:
|
85
|
+
- `racym_set`
|
86
|
+
- `racym_undo!`
|
87
|
+
|
88
|
+
For example, to test this simple method:
|
89
|
+
|
90
|
+
```ruby
|
91
|
+
class Foo
|
92
|
+
def self.hi
|
93
|
+
"Hi #{racym :person_to_hi}"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
```
|
97
|
+
|
98
|
+
```ruby
|
99
|
+
describe Foo do
|
100
|
+
describe ".hi" do
|
101
|
+
before { racym_set :person_to_hi, "Dave" }
|
102
|
+
specify { expect(Foo.hi).to eq "Hi Dave" }
|
103
|
+
after { racym_undo! }
|
104
|
+
end
|
105
|
+
end
|
106
|
+
```
|
107
|
+
|
108
|
+
## License
|
109
|
+
|
110
|
+
[MIT](LICENSE).
|
111
|
+
|
112
|
+
Library created by [UserTesting](https://usertesting.com)
|
26
113
|
|
27
|
-
|
114
|
+

|
28
115
|
|
29
116
|
## Contributing
|
30
117
|
|
31
|
-
1. Fork it
|
118
|
+
1. Fork it ( https://github.com/usertesting/racym/fork )
|
32
119
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
33
120
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
34
121
|
4. Push to the branch (`git push origin my-new-feature`)
|
35
|
-
5. Create new Pull Request
|
122
|
+
5. Create a new Pull Request
|
data/lib/racym/version.rb
CHANGED
data/racym.gemspec
CHANGED
@@ -13,14 +13,14 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = ""
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split($/)
|
16
|
+
spec.files = `git ls-files`.split($/).reject { |f| f.match(%r{^(spec|doc)/}) }
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency "railties", ">= 3.2.13","<
|
22
|
-
|
23
|
-
spec.add_development_dependency "bundler"
|
21
|
+
spec.add_dependency "railties", ">= 3.2.13","< 7.0"
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler"
|
24
24
|
spec.add_development_dependency "rake"
|
25
25
|
spec.add_development_dependency "rspec"
|
26
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: racym
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Raffauf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 3.2.13
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,21 +29,21 @@ dependencies:
|
|
29
29
|
version: 3.2.13
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.0'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bundler
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- - "
|
37
|
+
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '0'
|
40
40
|
type: :development
|
41
41
|
prerelease: false
|
42
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
|
-
- - "
|
44
|
+
- - ">="
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '0'
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- ".gitignore"
|
83
83
|
- ".ruby-version"
|
84
84
|
- ".travis.yml"
|
85
|
+
- CHANGELOG.markdown
|
85
86
|
- Gemfile
|
86
87
|
- LICENSE.txt
|
87
88
|
- README.md
|
@@ -89,7 +90,6 @@ files:
|
|
89
90
|
- lib/racym.rb
|
90
91
|
- lib/racym/version.rb
|
91
92
|
- racym.gemspec
|
92
|
-
- spec/lib/racym_spec.rb
|
93
93
|
homepage: ''
|
94
94
|
licenses:
|
95
95
|
- MIT
|
@@ -109,11 +109,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
|
-
|
113
|
-
rubygems_version: 2.4.8
|
112
|
+
rubygems_version: 3.0.3
|
114
113
|
signing_key:
|
115
114
|
specification_version: 4
|
116
115
|
summary: Used as a shortcut to rails configuration.
|
117
|
-
test_files:
|
118
|
-
- spec/lib/racym_spec.rb
|
119
|
-
has_rdoc:
|
116
|
+
test_files: []
|