lookup_by 0.10.9 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +17 -9
  4. data/Appraisals +6 -6
  5. data/CHANGELOG.md +58 -0
  6. data/Gemfile +6 -10
  7. data/MIT-LICENSE +1 -1
  8. data/README.md +30 -27
  9. data/Rakefile +20 -2
  10. data/circle.yml +4 -2
  11. data/gemfiles/rails_6.0.gemfile +17 -0
  12. data/gemfiles/rails_6.1.gemfile +17 -0
  13. data/gemfiles/rails_7.0.gemfile +17 -0
  14. data/lib/lookup_by/association.rb +9 -3
  15. data/lib/lookup_by/cache.rb +17 -21
  16. data/lib/lookup_by/caching/safe_lru.rb +1 -1
  17. data/lib/lookup_by/hooks/formtastic.rb +2 -1
  18. data/lib/lookup_by/hooks/simple_form.rb +2 -1
  19. data/lib/lookup_by/lookup.rb +27 -13
  20. data/lib/lookup_by/version.rb +1 -1
  21. data/lib/lookup_by.rb +2 -0
  22. data/lookup_by.gemspec +2 -2
  23. data/spec/association_spec.rb +1 -0
  24. data/spec/cache_spec.rb +10 -0
  25. data/spec/{dummy → internal}/app/models/account.rb +0 -0
  26. data/spec/{dummy → internal}/app/models/address.rb +0 -0
  27. data/spec/{dummy → internal}/app/models/city.rb +0 -0
  28. data/spec/{dummy → internal}/app/models/country.rb +0 -0
  29. data/spec/{dummy → internal}/app/models/email_address.rb +0 -0
  30. data/spec/{dummy → internal}/app/models/ip_address.rb +0 -0
  31. data/spec/{dummy → internal}/app/models/path.rb +0 -0
  32. data/spec/{dummy → internal}/app/models/phone_number.rb +0 -0
  33. data/spec/{dummy → internal}/app/models/postal_code.rb +0 -0
  34. data/spec/{dummy → internal}/app/models/raisin.rb +0 -0
  35. data/spec/{dummy → internal}/app/models/read_through_raisin.rb +0 -0
  36. data/spec/{dummy → internal}/app/models/state.rb +0 -0
  37. data/spec/{dummy → internal}/app/models/status.rb +0 -0
  38. data/spec/{dummy → internal}/app/models/street.rb +0 -0
  39. data/spec/{dummy → internal}/app/models/uncacheable.rb +0 -0
  40. data/spec/{dummy → internal}/app/models/unfindable.rb +0 -0
  41. data/spec/{dummy → internal}/app/models/unsynchronizable.rb +0 -0
  42. data/spec/{dummy → internal}/app/models/user_agent.rb +0 -0
  43. data/spec/internal/config/database.yml +8 -0
  44. data/spec/internal/db/schema.rb +49 -0
  45. data/spec/{dummy → internal}/lib/missing.rb +0 -0
  46. data/spec/internal/log/.gitignore +1 -0
  47. data/spec/lookup_by_spec.rb +22 -6
  48. data/spec/rails_helper.rb +6 -13
  49. data/spec/support/shared_examples_for_a_lookup.rb +28 -7
  50. metadata +58 -94
  51. data/gemfiles/rails_4.0.gemfile +0 -22
  52. data/gemfiles/rails_4.1.gemfile +0 -22
  53. data/gemfiles/rails_4.2.gemfile +0 -22
  54. data/spec/dummy/Rakefile +0 -22
  55. data/spec/dummy/app/models/.gitkeep +0 -0
  56. data/spec/dummy/bin/bundle +0 -3
  57. data/spec/dummy/bin/rails +0 -4
  58. data/spec/dummy/bin/rake +0 -4
  59. data/spec/dummy/config/application.rb +0 -28
  60. data/spec/dummy/config/boot.rb +0 -6
  61. data/spec/dummy/config/database.yml +0 -44
  62. data/spec/dummy/config/environment.rb +0 -5
  63. data/spec/dummy/config/environments/development.rb +0 -20
  64. data/spec/dummy/config/environments/test.rb +0 -19
  65. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
  66. data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  67. data/spec/dummy/config/initializers/inflections.rb +0 -16
  68. data/spec/dummy/config/locales/en.yml +0 -23
  69. data/spec/dummy/config.ru +0 -4
  70. data/spec/dummy/db/migrate/20121019040009_create_tables.rb +0 -41
  71. data/spec/dummy/db/seeds.rb +0 -1
  72. data/spec/dummy/db/structure.sql +0 -1053
  73. data/spec/dummy/log/.gitkeep +0 -0
  74. data/spec/dummy/script/rails +0 -6
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,8 @@
1
+ development:
2
+ adapter: postgresql
3
+ database: lookup_by_development
4
+
5
+ # Combustion uses the "test" config even when Rails.env.development?
6
+ test:
7
+ adapter: postgresql
8
+ database: lookup_by_<%= Rails.env %>
@@ -0,0 +1,49 @@
1
+ ActiveRecord::Schema.define do
2
+ enable_extension "plpgsql"
3
+ enable_extension "uuid-ossp"
4
+ enable_extension "pgcrypto"
5
+
6
+ create_lookup_tables :cities, :states, :postal_codes, :streets, :countries
7
+
8
+ create_lookup_table :user_agents
9
+ create_lookup_table :email_addresses
10
+
11
+
12
+ create_lookup_table :statuses, small: true
13
+
14
+ create_lookup_table :ip_addresses, lookup_type: :inet
15
+
16
+ create_lookup_table :phone_numbers
17
+
18
+ create_lookup_table :uncacheables
19
+ create_lookup_table :unfindables
20
+
21
+ create_lookup_table :raisins
22
+ create_lookup_table :read_through_raisins
23
+
24
+ create_lookup_table :unsynchronizables
25
+
26
+ enable_extension 'uuid-ossp'
27
+
28
+ execute 'CREATE SCHEMA traffic;'
29
+
30
+ create_lookup_table :paths, schema: 'traffic', id: :uuid
31
+
32
+ create_lookup_table :accounts do |t|
33
+ t.belongs_to :phone_number
34
+ end
35
+
36
+ create_lookup_table :addresses do |t|
37
+ t.belongs_to :city
38
+ t.belongs_to :state
39
+ t.belongs_to :postal_code
40
+ t.belongs_to :street
41
+ t.belongs_to :country
42
+ end
43
+ end
44
+
45
+ print 'Seeding db...'
46
+
47
+ State.lookup.create(name: 'AL')
48
+
49
+ puts 'done'
File without changes
@@ -0,0 +1 @@
1
+ *.log
@@ -22,7 +22,10 @@ describe LookupBy do
22
22
  describe ".clear" do
23
23
  it "clears all lookup caches" do
24
24
  Path.lookup.cache[1] = "remove-this"
25
- expect { LookupBy.clear }.to change { Path.lookup.cache.size }
25
+ Path.lookup.reverse["remove-this"] = "remove-this"
26
+
27
+ expect { LookupBy.clear }.to change { Path.lookup.cache.size }.
28
+ and change { Path.lookup.reverse.size }
26
29
  end
27
30
  end
28
31
 
@@ -75,16 +78,29 @@ describe LookupBy::Lookup::ClassMethods do
75
78
  it "accepts duplicates" do
76
79
  expect { City.seed 'Chicago', 'Chicago' }.not_to raise_error
77
80
 
78
- if Rails::VERSION::MAJOR == 4 && Rails::VERSION::MINOR == 0
79
- expect(City.pluck(:city)).to eq(['Chicago'])
80
- else
81
- expect(City.pluck(:name)).to eq(['Chicago'])
82
- end
81
+ expect(City.pluck(:city)).to eq(['Chicago'])
83
82
  end
84
83
  end
85
84
  end
86
85
 
87
86
  describe LookupBy::Lookup do
87
+ describe "#clear" do
88
+ it "clears the cache" do
89
+ expect(State.lookup.cache).to be_present
90
+ State.lookup.clear
91
+ expect(State.lookup.cache).to be_empty
92
+ end
93
+ end
94
+
95
+ describe "#load" do
96
+ it "populates the cache" do
97
+ State.lookup.clear
98
+ expect(State.lookup.cache).to be_empty
99
+ State.lookup.load
100
+ expect(State.lookup.cache).to be_present
101
+ end
102
+ end
103
+
88
104
  context "Uncacheable.lookup_by :column, cache: true, find_or_create: true" do
89
105
  it "fails when trying to cache and write-through" do
90
106
  expect { Uncacheable }.to raise_error(ArgumentError)
data/spec/rails_helper.rb CHANGED
@@ -1,27 +1,20 @@
1
1
  # This file is copied to spec/ when you run 'rails generate rspec:install'
2
2
  ENV["RAILS_ENV"] ||= 'test'
3
+
4
+ require 'combustion'
5
+
6
+ Combustion.initialize! :active_record
7
+
3
8
  require 'spec_helper'
4
9
 
5
10
  if ENV["COVERAGE"]
6
11
  require 'simplecov'
7
- require 'coveralls'
8
-
9
- SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
10
- Coveralls::SimpleCov::Formatter,
11
- SimpleCov::Formatter::HTMLFormatter
12
- ]
13
12
 
13
+ SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
14
14
  SimpleCov.start
15
15
  end
16
16
 
17
- begin
18
- require File.expand_path("../../config/environment", __FILE__)
19
- rescue LoadError
20
- require File.expand_path("../dummy/config/environment", __FILE__)
21
- end
22
-
23
17
  require 'pry'
24
- require 'rspec/its'
25
18
  require 'rspec/rails'
26
19
 
27
20
  # Requires supporting ruby files with custom matchers and macros, etc, in
@@ -8,6 +8,25 @@ shared_examples "a lookup" do
8
8
  expect(subject.is_a_lookup?).to be true
9
9
  end
10
10
 
11
+ it "seeds a single value" do
12
+ subject.seed "Missing"
13
+
14
+ expect(subject.pluck(subject.lookup.field)).to include('Missing')
15
+ end
16
+
17
+ it "seeds multiple values" do
18
+ subject.seed "New 1", "New 2"
19
+
20
+ expect(subject.pluck(subject.lookup.field)).to include('New 1', 'New 2')
21
+ end
22
+
23
+ it "seeds without duplicates" do
24
+ subject.seed "Missing", "Missing"
25
+ subject.seed "Missing"
26
+
27
+ expect(subject.pluck(subject.lookup.field)).to include('Missing')
28
+ end
29
+
11
30
  it "raises with no args" do
12
31
  expect { subject[] }.to raise_error ArgumentError
13
32
  end
@@ -39,6 +58,14 @@ shared_examples "a lookup" do
39
58
  it "proxies create!" do
40
59
  expect { subject.lookup.create!(name: "add to cache") }.to change(subject, :count).by(1)
41
60
  end
61
+
62
+ it "doesn't break first_or_create! called on a scope" do
63
+ subject.where(subject.lookup.field => "Missing").first_or_create!
64
+
65
+ subject.lookup.reload
66
+
67
+ expect(subject.pluck(subject.lookup.field)).to include("Missing")
68
+ end
42
69
  end
43
70
 
44
71
  shared_examples "a proxy" do
@@ -108,17 +135,11 @@ shared_examples "a strict cache" do
108
135
  expect { subject.create(name: "new") }.to_not change(subject, :count)
109
136
  end
110
137
 
111
- xit "does cache .all" do
138
+ it "caches .all" do
112
139
  new = subject.create(name: 'add')
113
140
  expect(subject.all.to_a).not_to include(new)
114
141
  end
115
142
 
116
- xit "reloads .all when called with args" do
117
- new = subject.create(name: "new")
118
- expect(subject.all.to_a).not_to include(new)
119
- expect(subject.all({}).to_a).to include(new)
120
- end
121
-
122
143
  it "caches .pluck" do
123
144
  subject.create(name: "pluck this")
124
145
  expect(subject.pluck(:name)).not_to include("pluck this")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookup_by
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.9
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Peterson
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-28 00:00:00.000000000 Z
11
+ date: 2022-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,28 +16,28 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: 6.0.0
20
20
  type: :runtime
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: 4.0.0
26
+ version: 6.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.7.0
33
+ version: 2.3.3
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.7.0
40
+ version: 2.3.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rake
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -64,15 +64,16 @@ files:
64
64
  - ".travis.yml"
65
65
  - ".yardopts"
66
66
  - Appraisals
67
+ - CHANGELOG.md
67
68
  - Gemfile
68
69
  - MIT-LICENSE
69
70
  - README.md
70
71
  - Rakefile
71
72
  - TODO.md
72
73
  - circle.yml
73
- - gemfiles/rails_4.0.gemfile
74
- - gemfiles/rails_4.1.gemfile
75
- - gemfiles/rails_4.2.gemfile
74
+ - gemfiles/rails_6.0.gemfile
75
+ - gemfiles/rails_6.1.gemfile
76
+ - gemfiles/rails_7.0.gemfile
76
77
  - lib/lookup_by.rb
77
78
  - lib/lookup_by/association.rb
78
79
  - lib/lookup_by/cache.rb
@@ -90,46 +91,28 @@ files:
90
91
  - spec/association_spec.rb
91
92
  - spec/cache_spec.rb
92
93
  - spec/caching/lru_spec.rb
93
- - spec/dummy/Rakefile
94
- - spec/dummy/app/models/.gitkeep
95
- - spec/dummy/app/models/account.rb
96
- - spec/dummy/app/models/address.rb
97
- - spec/dummy/app/models/city.rb
98
- - spec/dummy/app/models/country.rb
99
- - spec/dummy/app/models/email_address.rb
100
- - spec/dummy/app/models/ip_address.rb
101
- - spec/dummy/app/models/path.rb
102
- - spec/dummy/app/models/phone_number.rb
103
- - spec/dummy/app/models/postal_code.rb
104
- - spec/dummy/app/models/raisin.rb
105
- - spec/dummy/app/models/read_through_raisin.rb
106
- - spec/dummy/app/models/state.rb
107
- - spec/dummy/app/models/status.rb
108
- - spec/dummy/app/models/street.rb
109
- - spec/dummy/app/models/uncacheable.rb
110
- - spec/dummy/app/models/unfindable.rb
111
- - spec/dummy/app/models/unsynchronizable.rb
112
- - spec/dummy/app/models/user_agent.rb
113
- - spec/dummy/bin/bundle
114
- - spec/dummy/bin/rails
115
- - spec/dummy/bin/rake
116
- - spec/dummy/config.ru
117
- - spec/dummy/config/application.rb
118
- - spec/dummy/config/boot.rb
119
- - spec/dummy/config/database.yml
120
- - spec/dummy/config/environment.rb
121
- - spec/dummy/config/environments/development.rb
122
- - spec/dummy/config/environments/test.rb
123
- - spec/dummy/config/initializers/backtrace_silencers.rb
124
- - spec/dummy/config/initializers/filter_parameter_logging.rb
125
- - spec/dummy/config/initializers/inflections.rb
126
- - spec/dummy/config/locales/en.yml
127
- - spec/dummy/db/migrate/20121019040009_create_tables.rb
128
- - spec/dummy/db/seeds.rb
129
- - spec/dummy/db/structure.sql
130
- - spec/dummy/lib/missing.rb
131
- - spec/dummy/log/.gitkeep
132
- - spec/dummy/script/rails
94
+ - spec/internal/app/models/account.rb
95
+ - spec/internal/app/models/address.rb
96
+ - spec/internal/app/models/city.rb
97
+ - spec/internal/app/models/country.rb
98
+ - spec/internal/app/models/email_address.rb
99
+ - spec/internal/app/models/ip_address.rb
100
+ - spec/internal/app/models/path.rb
101
+ - spec/internal/app/models/phone_number.rb
102
+ - spec/internal/app/models/postal_code.rb
103
+ - spec/internal/app/models/raisin.rb
104
+ - spec/internal/app/models/read_through_raisin.rb
105
+ - spec/internal/app/models/state.rb
106
+ - spec/internal/app/models/status.rb
107
+ - spec/internal/app/models/street.rb
108
+ - spec/internal/app/models/uncacheable.rb
109
+ - spec/internal/app/models/unfindable.rb
110
+ - spec/internal/app/models/unsynchronizable.rb
111
+ - spec/internal/app/models/user_agent.rb
112
+ - spec/internal/config/database.yml
113
+ - spec/internal/db/schema.rb
114
+ - spec/internal/lib/missing.rb
115
+ - spec/internal/log/.gitignore
133
116
  - spec/lookup_by_spec.rb
134
117
  - spec/rails_helper.rb
135
118
  - spec/rubinius_helper.rb
@@ -139,7 +122,7 @@ homepage: https://www.github.com/companygardener/lookup_by
139
122
  licenses:
140
123
  - MIT
141
124
  metadata: {}
142
- post_install_message:
125
+ post_install_message:
143
126
  rdoc_options: []
144
127
  require_paths:
145
128
  - lib
@@ -154,55 +137,36 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
137
  - !ruby/object:Gem::Version
155
138
  version: '0'
156
139
  requirements: []
157
- rubyforge_project:
158
- rubygems_version: 2.5.2
159
- signing_key:
140
+ rubygems_version: 3.3.11
141
+ signing_key:
160
142
  specification_version: 4
161
143
  summary: A thread-safe lookup table cache for ActiveRecord
162
144
  test_files:
163
145
  - spec/association_spec.rb
164
146
  - spec/cache_spec.rb
165
147
  - spec/caching/lru_spec.rb
166
- - spec/dummy/Rakefile
167
- - spec/dummy/app/models/.gitkeep
168
- - spec/dummy/app/models/account.rb
169
- - spec/dummy/app/models/address.rb
170
- - spec/dummy/app/models/city.rb
171
- - spec/dummy/app/models/country.rb
172
- - spec/dummy/app/models/email_address.rb
173
- - spec/dummy/app/models/ip_address.rb
174
- - spec/dummy/app/models/path.rb
175
- - spec/dummy/app/models/phone_number.rb
176
- - spec/dummy/app/models/postal_code.rb
177
- - spec/dummy/app/models/raisin.rb
178
- - spec/dummy/app/models/read_through_raisin.rb
179
- - spec/dummy/app/models/state.rb
180
- - spec/dummy/app/models/status.rb
181
- - spec/dummy/app/models/street.rb
182
- - spec/dummy/app/models/uncacheable.rb
183
- - spec/dummy/app/models/unfindable.rb
184
- - spec/dummy/app/models/unsynchronizable.rb
185
- - spec/dummy/app/models/user_agent.rb
186
- - spec/dummy/bin/bundle
187
- - spec/dummy/bin/rails
188
- - spec/dummy/bin/rake
189
- - spec/dummy/config.ru
190
- - spec/dummy/config/application.rb
191
- - spec/dummy/config/boot.rb
192
- - spec/dummy/config/database.yml
193
- - spec/dummy/config/environment.rb
194
- - spec/dummy/config/environments/development.rb
195
- - spec/dummy/config/environments/test.rb
196
- - spec/dummy/config/initializers/backtrace_silencers.rb
197
- - spec/dummy/config/initializers/filter_parameter_logging.rb
198
- - spec/dummy/config/initializers/inflections.rb
199
- - spec/dummy/config/locales/en.yml
200
- - spec/dummy/db/migrate/20121019040009_create_tables.rb
201
- - spec/dummy/db/seeds.rb
202
- - spec/dummy/db/structure.sql
203
- - spec/dummy/lib/missing.rb
204
- - spec/dummy/log/.gitkeep
205
- - spec/dummy/script/rails
148
+ - spec/internal/app/models/account.rb
149
+ - spec/internal/app/models/address.rb
150
+ - spec/internal/app/models/city.rb
151
+ - spec/internal/app/models/country.rb
152
+ - spec/internal/app/models/email_address.rb
153
+ - spec/internal/app/models/ip_address.rb
154
+ - spec/internal/app/models/path.rb
155
+ - spec/internal/app/models/phone_number.rb
156
+ - spec/internal/app/models/postal_code.rb
157
+ - spec/internal/app/models/raisin.rb
158
+ - spec/internal/app/models/read_through_raisin.rb
159
+ - spec/internal/app/models/state.rb
160
+ - spec/internal/app/models/status.rb
161
+ - spec/internal/app/models/street.rb
162
+ - spec/internal/app/models/uncacheable.rb
163
+ - spec/internal/app/models/unfindable.rb
164
+ - spec/internal/app/models/unsynchronizable.rb
165
+ - spec/internal/app/models/user_agent.rb
166
+ - spec/internal/config/database.yml
167
+ - spec/internal/db/schema.rb
168
+ - spec/internal/lib/missing.rb
169
+ - spec/internal/log/.gitignore
206
170
  - spec/lookup_by_spec.rb
207
171
  - spec/rails_helper.rb
208
172
  - spec/rubinius_helper.rb
@@ -1,22 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.0.0"
6
-
7
- group :development, :test do
8
- gem "appraisal", "~> 2.1.0", :require => false
9
- gem "rspec"
10
- gem "rspec-its"
11
- gem "rspec-rails"
12
- gem "pg", :platform => :ruby
13
- gem "activerecord-jdbcpostgresql-adapter", :platform => :jruby
14
- gem "simplecov", :require => false
15
- gem "coveralls", :require => false
16
- gem "pry", :require => false
17
- gem "colored", :require => false
18
- gem "racc"
19
- gem "json"
20
- end
21
-
22
- gemspec :path => "../"
@@ -1,22 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.1.0"
6
-
7
- group :development, :test do
8
- gem "appraisal", "~> 2.1.0", :require => false
9
- gem "rspec"
10
- gem "rspec-its"
11
- gem "rspec-rails"
12
- gem "pg", :platform => :ruby
13
- gem "activerecord-jdbcpostgresql-adapter", :platform => :jruby
14
- gem "simplecov", :require => false
15
- gem "coveralls", :require => false
16
- gem "pry", :require => false
17
- gem "colored", :require => false
18
- gem "racc"
19
- gem "json"
20
- end
21
-
22
- gemspec :path => "../"
@@ -1,22 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "rails", "~> 4.2.0"
6
-
7
- group :development, :test do
8
- gem "appraisal", "~> 2.1.0", :require => false
9
- gem "rspec"
10
- gem "rspec-its"
11
- gem "rspec-rails"
12
- gem "pg", :platform => :ruby
13
- gem "activerecord-jdbcpostgresql-adapter", :platform => :jruby
14
- gem "simplecov", :require => false
15
- gem "coveralls", :require => false
16
- gem "pry", :require => false
17
- gem "colored", :require => false
18
- gem "racc"
19
- gem "json"
20
- end
21
-
22
- gemspec :path => "../"
data/spec/dummy/Rakefile DELETED
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env rake
2
- # Add your own tasks in files placed in lib/tasks ending in .rake,
3
- # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
4
-
5
- require File.expand_path('../config/application', __FILE__)
6
-
7
- Dummy::Application.load_tasks
8
-
9
- require "rspec/core/rake_task"
10
- RSpec::Core::RakeTask.new(:spec) do |config|
11
- config.pattern = FileList["../**/*_spec.rb"]
12
- end
13
-
14
- task :default => :spec
15
-
16
- namespace :db do
17
- namespace :test do
18
- task :load_structure => :environment do
19
- Rake::Task["db:seed"].invoke
20
- end
21
- end
22
- end
File without changes
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
- load Gem.bin_path('bundler', 'bundle')
data/spec/dummy/bin/rails DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- APP_PATH = File.expand_path('../../config/application', __FILE__)
3
- require_relative '../config/boot'
4
- require 'rails/commands'
data/spec/dummy/bin/rake DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require_relative '../config/boot'
3
- require 'rake'
4
- Rake.application.run
@@ -1,28 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'active_record/railtie'
4
-
5
- # Require the gems listed in Gemfile, including any gems
6
- # you've limited to :test, :development, or :production.
7
- Bundler.require(:default, Rails.env)
8
-
9
- require "lookup_by"
10
-
11
- module Dummy
12
- class Application < Rails::Application
13
- # Settings in config/environments/* take precedence over those specified here.
14
- # Application configuration should go into files in config/initializers
15
- # -- all .rb files in that directory are automatically loaded.
16
-
17
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
18
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
19
- # config.time_zone = 'Central Time (US & Canada)'
20
-
21
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
22
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
23
- # config.i18n.default_locale = :de
24
-
25
- config.active_record.schema_format = :sql
26
- end
27
- end
28
-
@@ -1,6 +0,0 @@
1
- # Set up gems listed in the Gemfile.
2
- ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])
5
-
6
- $:.unshift File.expand_path('../../../../lib', __FILE__)