data_set 1.1.0 → 2.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: caa18f4d914cda971f5e591e08c0c464a48c120b
4
- data.tar.gz: 2ca5ae69c875af99ddab7b734f891884490e4df4
3
+ metadata.gz: 989b6c5b4029c857b0769e0a857f03f5a0e5da94
4
+ data.tar.gz: 4fb27a0570e1593773ec99f10e688c148840417c
5
5
  SHA512:
6
- metadata.gz: 9030f179a10cb4241af98e38d22950aaa8453b811dad50e342f9a231d96dc93ddc81ab66c5dd2dfa09eb5456770500ad5104a8429c70b521b999026d945fa714
7
- data.tar.gz: d1e1f21aa566a99c9b742cc69cad0dac2d9d93c35f1b378dbb4d7d7f3567049109b271560413d8d7a855210a52844ad16ef3a6c47704a92b8c07864615b8811f
6
+ metadata.gz: ed67d2f20782b11563772367f154110be46fb39dd17113daf018f3576f4ec24bf23fd92f7edc5ecd10498c3493351c8dad31f91b8db74f919eedac836a17038f
7
+ data.tar.gz: f2c84cefe03be53781754e0d223faccba27f776dfdb89dcd32a3c08884b494ae5f35b5b770ae0e55ebdec924a8eaaadaed2eb93ae684ed991007274f99908030
data/.gitignore CHANGED
@@ -1,40 +1,49 @@
1
- # Ruby-Specific
1
+ # Ruby Generated
2
2
 
3
+ /Gemfile.lock
3
4
  /.bundle/
4
5
  /.yardoc
5
- /Gemfile.lock
6
6
  /_yardoc/
7
-
8
- # Ouput-Specific
9
-
10
7
  /coverage/
11
8
  /doc/
12
9
  /pkg/
13
10
  /spec/reports/
11
+ /spec/coverage/
14
12
  /tmp/
15
- *.log
16
- *.tmp
17
- *.swp
18
- *.bak
19
13
 
20
- # IDE-Specific
14
+ # Generated Reports
15
+ reports/
21
16
 
22
- .idea
23
- .settings
24
- .project
25
- .classpath
26
- *.iws
17
+ # Rspec Failure Tracking
27
18
 
28
- # Windows-Specific
19
+ .rspec_status
29
20
 
30
- Thumbs.db
21
+ # IDE Files
31
22
 
32
- # Mac OS-Specific
33
-
34
- *.DS_Store
35
- ._*
23
+ .idea/
24
+ *.iml
25
+ *.iws
26
+ *.ipr
27
+ .vscode/
28
+ .settings/
29
+ .metadata
30
+ .classpath
31
+ .loadpath
32
+ .buildpath
33
+ .project
36
34
 
37
- # Linux-Specific
35
+ # OS Files
38
36
 
39
- .directory
40
- .Trash-*
37
+ .DS_Store
38
+ .DS_Store?
39
+ ._*
40
+ .Spotlight-V100
41
+ .Trashes
42
+ ehthumbs.db
43
+ Thumbs.db
44
+ $RECYCLE.BIN/
45
+ Desktop.ini
46
+ *.tmp
47
+ *.bak
48
+ *.swp
49
+ *~.nib
data/Gemfile CHANGED
@@ -1,4 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- # Specify your gem's dependencies in data_set.gemspec
3
+ gem "coveralls", require: false
4
+
4
5
  gemspec
File without changes
data/README.md CHANGED
@@ -1,9 +1,7 @@
1
1
  # DataSet
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/data_set.svg)](http://badge.fury.io/rb/data_set)
4
- [![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jeffnyman/data_set/blob/master/LICENSE.txt)
5
-
6
- [![Dependency Status](https://gemnasium.com/jeffnyman/data_set.png)](https://gemnasium.com/jeffnyman/data_set)
4
+ [![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/jeffnyman/data_set/blob/master/LICENSE.md)
7
5
 
8
6
  DataSet provides an easy mechanism to load up a set of data from a YAML file and then access that data by the structuring keys of the file. This provides an expressive way to retrieve data values.
9
7
 
@@ -15,13 +13,23 @@ To get the latest stable release, add this line to your application's Gemfile:
15
13
  gem 'data_set'
16
14
  ```
17
15
 
18
- And then include it in your bundle:
16
+ To get the latest code:
17
+
18
+ ```ruby
19
+ gem 'data_set', git: 'https://github.com/jeffnyman/data_set'
20
+ ```
19
21
 
20
- $ bundle
22
+ After doing one of the above, execute the following command:
23
+
24
+ ```
25
+ $ bundle
26
+ ```
21
27
 
22
28
  You can also install DataSet just as you would any other gem:
23
29
 
24
- $ gem install data_set
30
+ ```
31
+ $ gem install data_set
32
+ ```
25
33
 
26
34
  ## Usage
27
35
 
@@ -118,7 +126,11 @@ This would allow the specific environment variable to be set conditionally based
118
126
 
119
127
  ## Development
120
128
 
121
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec:all` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`.
129
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec:all` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
130
+
131
+ The default `rake` command will run all tests as well as a RuboCop analysis.
132
+
133
+ To install this gem onto your local machine, run `bundle exec rake install`.
122
134
 
123
135
  ## Contributing
124
136
 
@@ -143,4 +155,4 @@ This code is loosely based upon the [FigNewton](https://github.com/cheezy/fig_ne
143
155
  ## License
144
156
 
145
157
  DataSet is distributed under the [MIT](http://www.opensource.org/licenses/MIT) license.
146
- See the [LICENSE](https://github.com/jeffnyman/data_set/blob/master/LICENSE.txt) file for details.
158
+ See the [LICENSE](https://github.com/jeffnyman/data_set/blob/master/LICENSE.md) file for details.
data/Rakefile CHANGED
@@ -11,6 +11,7 @@ namespace :spec do
11
11
  desc 'Clean all generated reports'
12
12
  task :clean do
13
13
  system('rm -rf spec/reports')
14
+ system('rm -rf spec/coverage')
14
15
  end
15
16
 
16
17
  RSpec::Core::RakeTask.new(all: :clean) do |config|
@@ -15,7 +15,7 @@ euler_number: 2.718
15
15
  truthhood: true
16
16
  falsehood: false
17
17
 
18
- symbolic: :symbol
18
+ # symbolic: :symbol
19
19
 
20
20
  invalid_conditions:
21
21
  - only letters
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.13"
24
+ spec.add_development_dependency "bundler", "~> 2.0"
25
25
  spec.add_development_dependency "rake", "~> 10.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
27
  spec.add_development_dependency "cucumber", "~> 3.0"
@@ -9,7 +9,7 @@ module DataSet
9
9
  extend DataSet::DataAccessor
10
10
 
11
11
  class << self
12
- attr_accessor :data
12
+ attr_accessor :data_contents
13
13
 
14
14
  def default_data_path
15
15
  'data'
@@ -3,9 +3,9 @@ require "yaml"
3
3
  module DataSet
4
4
  module DataAccessor
5
5
  def method_missing(*args, &block)
6
- load_data_source unless @data_source
6
+ load_data_source unless @data_contents
7
7
  key = args.first
8
- value = @data_source[key.to_s]
8
+ value = @data_contents[key.to_s]
9
9
  value = args[1] if value.nil?
10
10
  value = yield(key.to_s) if value.nil? && block
11
11
  super if value.nil?
@@ -18,14 +18,16 @@ module DataSet
18
18
  end
19
19
 
20
20
  def load_data_source
21
- @data_source = nil
21
+ @data_contents = nil
22
22
  path = "#{data_path}/#{ENV['DATA_SET_FILE']}"
23
+
23
24
  if ENV['DATA_SET_FILE']
24
- @data_source = ::YAML.safe_load(ERB.new(
25
+ @data_contents = ::YAML.safe_load(ERB.new(
25
26
  File.read(path)
26
27
  ).result(binding))
27
28
  end
28
- DataSet.load('default.yml') if @data_source.nil?
29
+
30
+ DataSet.load('default.yml') if @data_contents.nil?
29
31
  end
30
32
 
31
33
  private
@@ -5,11 +5,11 @@ module DataSet
5
5
  include DataSet::DataAccessor
6
6
 
7
7
  def initialize(value)
8
- @data_source = value
8
+ @data_contents = value
9
9
  end
10
10
 
11
11
  def to_hash
12
- @data_source
12
+ @data_contents
13
13
  end
14
14
  end
15
15
  end
@@ -1,3 +1,3 @@
1
1
  module DataSet
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "2.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_set
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Nyman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-05 00:00:00.000000000 Z
11
+ date: 2019-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.13'
19
+ version: '2.0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.13'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -121,7 +121,7 @@ files:
121
121
  - ".rubocop.yml"
122
122
  - CODE_OF_CONDUCT.md
123
123
  - Gemfile
124
- - LICENSE.txt
124
+ - LICENSE.md
125
125
  - README.md
126
126
  - Rakefile
127
127
  - bin/console
@@ -139,7 +139,7 @@ licenses:
139
139
  - MIT
140
140
  metadata: {}
141
141
  post_install_message: "\n(::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::) (::)\n
142
- \ DataSet 1.1.0 has been installed.\n(::) (::) (::) (::) (::) (::) (::) (::) (::)
142
+ \ DataSet 2.0.0 has been installed.\n(::) (::) (::) (::) (::) (::) (::) (::) (::)
143
143
  (::) (::) (::)\n "
144
144
  rdoc_options: []
145
145
  require_paths:
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.6.13
159
+ rubygems_version: 2.5.2
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Provides configuration specification and retrieval using YAML files.