inter 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +1 -0
  3. data/.rspec +1 -0
  4. data/.ruby-gemset +1 -0
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +4 -0
  7. data/Gemfile +3 -0
  8. data/Gemfile.lock +102 -0
  9. data/LICENSE +23 -0
  10. data/README.md +176 -0
  11. data/Rakefile +9 -0
  12. data/inter.gemspec +25 -0
  13. data/lib/generators/inter/install_generator.rb +15 -0
  14. data/lib/generators/templates/create_interactions.rb +13 -0
  15. data/lib/inter.rb +2 -0
  16. data/lib/inter/actable.rb +172 -0
  17. data/lib/inter/action.rb +26 -0
  18. data/lib/inter/version.rb +3 -0
  19. data/spec/class_spec.rb +38 -0
  20. data/spec/dummy/Rakefile +6 -0
  21. data/spec/dummy/app/assets/images/.keep +0 -0
  22. data/spec/dummy/app/assets/javascripts/application.js +16 -0
  23. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  24. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  25. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  26. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  27. data/spec/dummy/app/mailers/.keep +0 -0
  28. data/spec/dummy/app/models/.keep +0 -0
  29. data/spec/dummy/app/models/article.rb +3 -0
  30. data/spec/dummy/app/models/concerns/.keep +0 -0
  31. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  32. data/spec/dummy/bin/bundle +3 -0
  33. data/spec/dummy/bin/rails +4 -0
  34. data/spec/dummy/bin/rake +4 -0
  35. data/spec/dummy/config.ru +4 -0
  36. data/spec/dummy/config/application.rb +24 -0
  37. data/spec/dummy/config/boot.rb +4 -0
  38. data/spec/dummy/config/database.yml +25 -0
  39. data/spec/dummy/config/environment.rb +5 -0
  40. data/spec/dummy/config/environments/development.rb +29 -0
  41. data/spec/dummy/config/environments/production.rb +80 -0
  42. data/spec/dummy/config/environments/test.rb +36 -0
  43. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  44. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  45. data/spec/dummy/config/initializers/inflections.rb +16 -0
  46. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  47. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  48. data/spec/dummy/config/initializers/session_store.rb +3 -0
  49. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  50. data/spec/dummy/config/locales/en.yml +23 -0
  51. data/spec/dummy/config/routes.rb +56 -0
  52. data/spec/dummy/db/development.sqlite3 +0 -0
  53. data/spec/dummy/db/migrate/20131111155047_create_interactions.rb +13 -0
  54. data/spec/dummy/db/migrate/20131111233640_create_articles.rb +7 -0
  55. data/spec/dummy/db/schema.rb +30 -0
  56. data/spec/dummy/db/seeds.rb +7 -0
  57. data/spec/dummy/db/test.sqlite3 +0 -0
  58. data/spec/dummy/lib/assets/.keep +0 -0
  59. data/spec/dummy/lib/tasks/.keep +0 -0
  60. data/spec/dummy/log/.keep +0 -0
  61. data/spec/dummy/log/development.log +20 -0
  62. data/spec/dummy/log/test.log +41749 -0
  63. data/spec/dummy/public/404.html +58 -0
  64. data/spec/dummy/public/422.html +58 -0
  65. data/spec/dummy/public/500.html +57 -0
  66. data/spec/dummy/public/favicon.ico +0 -0
  67. data/spec/dummy/public/robots.txt +5 -0
  68. data/spec/dummy/test/controllers/.keep +0 -0
  69. data/spec/dummy/test/fixtures/.keep +0 -0
  70. data/spec/dummy/test/helpers/.keep +0 -0
  71. data/spec/dummy/test/integration/.keep +0 -0
  72. data/spec/dummy/test/mailers/.keep +0 -0
  73. data/spec/dummy/test/models/.keep +0 -0
  74. data/spec/dummy/test/test_helper.rb +15 -0
  75. data/spec/dummy/vendor/assets/javascripts/.keep +0 -0
  76. data/spec/dummy/vendor/assets/stylesheets/.keep +0 -0
  77. data/spec/instance_spec.rb +337 -0
  78. data/spec/related_spec.rb +43 -0
  79. data/spec/spec_helper.rb +15 -0
  80. metadata +240 -0
@@ -0,0 +1,43 @@
1
+ require 'spec_helper'
2
+
3
+ describe "Inter::Actable Relations" do
4
+
5
+ describe "records" do
6
+ pending "#*_records"
7
+ pending "#not_*_records"
8
+
9
+ pending "#*_and_not_*_records"
10
+ pending "#not_*_and_*_records"
11
+
12
+ pending "#*_and_not_*_and_*_records"
13
+ end
14
+
15
+ describe "ids" do
16
+ pending "#*_records_ids"
17
+ pending "#not_*_records_ids"
18
+
19
+ pending "#*_and_not_*_records_ids"
20
+ pending "#not_*_and_*_records_ids"
21
+
22
+ pending "#*_and_not_*_and_*_records_ids"
23
+ end
24
+
25
+ describe "counts" do
26
+ pending "#*_records_count"
27
+ pending "#not_*_records_count"
28
+
29
+ pending "#*_and_not_*_records_count"
30
+ pending "#not_*_and_*_records_count"
31
+
32
+ pending "#*_and_not_*_and_*_records_count"
33
+ end
34
+
35
+ describe "history" do
36
+ pending ".relation.history *string"
37
+ pending ".relation.history *symbol"
38
+ pending ".relation.history *implicit array"
39
+ pending ".relation.history *explicit array"
40
+ pending ".relation.history *implicit hash"
41
+ pending ".relation.history *explicit hash"
42
+ end
43
+ end
@@ -0,0 +1,15 @@
1
+ # Configure Rails Envinronment
2
+ ENV["RAILS_ENV"] = "test"
3
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
4
+
5
+ require 'rspec/rails'
6
+
7
+ ENGINE_RAILS_ROOT=File.join(File.dirname(__FILE__), '../')
8
+
9
+ # Requires supporting ruby files with custom matchers and macros, etc,
10
+ # in spec/support/ and its subdirectories.
11
+ Dir[File.join(ENGINE_RAILS_ROOT, "spec/support/**/*.rb")].each {|f| require f }
12
+
13
+ RSpec.configure do |config|
14
+ config.use_transactional_fixtures = true
15
+ end
metadata ADDED
@@ -0,0 +1,240 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: inter
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Cristiano Betta
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2013-11-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '>='
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sqlite3
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ description: An easy and simple way to keep track of interactions on an ActiveRecord
70
+ model that would normally require a lot of boolean attributes to make possible.
71
+ email:
72
+ - cbetta@gmail.com
73
+ executables: []
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - .gitignore
78
+ - .rspec
79
+ - .ruby-gemset
80
+ - .ruby-version
81
+ - .travis.yml
82
+ - Gemfile
83
+ - Gemfile.lock
84
+ - LICENSE
85
+ - README.md
86
+ - Rakefile
87
+ - inter.gemspec
88
+ - lib/generators/inter/install_generator.rb
89
+ - lib/generators/templates/create_interactions.rb
90
+ - lib/inter.rb
91
+ - lib/inter/actable.rb
92
+ - lib/inter/action.rb
93
+ - lib/inter/version.rb
94
+ - spec/class_spec.rb
95
+ - spec/dummy/Rakefile
96
+ - spec/dummy/app/assets/images/.keep
97
+ - spec/dummy/app/assets/javascripts/application.js
98
+ - spec/dummy/app/assets/stylesheets/application.css
99
+ - spec/dummy/app/controllers/application_controller.rb
100
+ - spec/dummy/app/controllers/concerns/.keep
101
+ - spec/dummy/app/helpers/application_helper.rb
102
+ - spec/dummy/app/mailers/.keep
103
+ - spec/dummy/app/models/.keep
104
+ - spec/dummy/app/models/article.rb
105
+ - spec/dummy/app/models/concerns/.keep
106
+ - spec/dummy/app/views/layouts/application.html.erb
107
+ - spec/dummy/bin/bundle
108
+ - spec/dummy/bin/rails
109
+ - spec/dummy/bin/rake
110
+ - spec/dummy/config.ru
111
+ - spec/dummy/config/application.rb
112
+ - spec/dummy/config/boot.rb
113
+ - spec/dummy/config/database.yml
114
+ - spec/dummy/config/environment.rb
115
+ - spec/dummy/config/environments/development.rb
116
+ - spec/dummy/config/environments/production.rb
117
+ - spec/dummy/config/environments/test.rb
118
+ - spec/dummy/config/initializers/backtrace_silencers.rb
119
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
120
+ - spec/dummy/config/initializers/inflections.rb
121
+ - spec/dummy/config/initializers/mime_types.rb
122
+ - spec/dummy/config/initializers/secret_token.rb
123
+ - spec/dummy/config/initializers/session_store.rb
124
+ - spec/dummy/config/initializers/wrap_parameters.rb
125
+ - spec/dummy/config/locales/en.yml
126
+ - spec/dummy/config/routes.rb
127
+ - spec/dummy/db/development.sqlite3
128
+ - spec/dummy/db/migrate/20131111155047_create_interactions.rb
129
+ - spec/dummy/db/migrate/20131111233640_create_articles.rb
130
+ - spec/dummy/db/schema.rb
131
+ - spec/dummy/db/seeds.rb
132
+ - spec/dummy/db/test.sqlite3
133
+ - spec/dummy/lib/assets/.keep
134
+ - spec/dummy/lib/tasks/.keep
135
+ - spec/dummy/log/.keep
136
+ - spec/dummy/log/development.log
137
+ - spec/dummy/log/test.log
138
+ - spec/dummy/public/404.html
139
+ - spec/dummy/public/422.html
140
+ - spec/dummy/public/500.html
141
+ - spec/dummy/public/favicon.ico
142
+ - spec/dummy/public/robots.txt
143
+ - spec/dummy/test/controllers/.keep
144
+ - spec/dummy/test/fixtures/.keep
145
+ - spec/dummy/test/helpers/.keep
146
+ - spec/dummy/test/integration/.keep
147
+ - spec/dummy/test/mailers/.keep
148
+ - spec/dummy/test/models/.keep
149
+ - spec/dummy/test/test_helper.rb
150
+ - spec/dummy/vendor/assets/javascripts/.keep
151
+ - spec/dummy/vendor/assets/stylesheets/.keep
152
+ - spec/instance_spec.rb
153
+ - spec/related_spec.rb
154
+ - spec/spec_helper.rb
155
+ homepage: http://github.com/cbetta/inter
156
+ licenses:
157
+ - MIT License
158
+ metadata: {}
159
+ post_install_message:
160
+ rdoc_options: []
161
+ require_paths:
162
+ - lib
163
+ required_ruby_version: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - '>='
166
+ - !ruby/object:Gem::Version
167
+ version: '0'
168
+ required_rubygems_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - '>='
171
+ - !ruby/object:Gem::Version
172
+ version: '0'
173
+ requirements: []
174
+ rubyforge_project:
175
+ rubygems_version: 2.0.6
176
+ signing_key:
177
+ specification_version: 4
178
+ summary: Smart interactions on any ActiveRecord model
179
+ test_files:
180
+ - spec/class_spec.rb
181
+ - spec/dummy/Rakefile
182
+ - spec/dummy/app/assets/images/.keep
183
+ - spec/dummy/app/assets/javascripts/application.js
184
+ - spec/dummy/app/assets/stylesheets/application.css
185
+ - spec/dummy/app/controllers/application_controller.rb
186
+ - spec/dummy/app/controllers/concerns/.keep
187
+ - spec/dummy/app/helpers/application_helper.rb
188
+ - spec/dummy/app/mailers/.keep
189
+ - spec/dummy/app/models/.keep
190
+ - spec/dummy/app/models/article.rb
191
+ - spec/dummy/app/models/concerns/.keep
192
+ - spec/dummy/app/views/layouts/application.html.erb
193
+ - spec/dummy/bin/bundle
194
+ - spec/dummy/bin/rails
195
+ - spec/dummy/bin/rake
196
+ - spec/dummy/config.ru
197
+ - spec/dummy/config/application.rb
198
+ - spec/dummy/config/boot.rb
199
+ - spec/dummy/config/database.yml
200
+ - spec/dummy/config/environment.rb
201
+ - spec/dummy/config/environments/development.rb
202
+ - spec/dummy/config/environments/production.rb
203
+ - spec/dummy/config/environments/test.rb
204
+ - spec/dummy/config/initializers/backtrace_silencers.rb
205
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
206
+ - spec/dummy/config/initializers/inflections.rb
207
+ - spec/dummy/config/initializers/mime_types.rb
208
+ - spec/dummy/config/initializers/secret_token.rb
209
+ - spec/dummy/config/initializers/session_store.rb
210
+ - spec/dummy/config/initializers/wrap_parameters.rb
211
+ - spec/dummy/config/locales/en.yml
212
+ - spec/dummy/config/routes.rb
213
+ - spec/dummy/db/development.sqlite3
214
+ - spec/dummy/db/migrate/20131111155047_create_interactions.rb
215
+ - spec/dummy/db/migrate/20131111233640_create_articles.rb
216
+ - spec/dummy/db/schema.rb
217
+ - spec/dummy/db/seeds.rb
218
+ - spec/dummy/db/test.sqlite3
219
+ - spec/dummy/lib/assets/.keep
220
+ - spec/dummy/lib/tasks/.keep
221
+ - spec/dummy/log/.keep
222
+ - spec/dummy/log/development.log
223
+ - spec/dummy/log/test.log
224
+ - spec/dummy/public/404.html
225
+ - spec/dummy/public/422.html
226
+ - spec/dummy/public/500.html
227
+ - spec/dummy/public/favicon.ico
228
+ - spec/dummy/public/robots.txt
229
+ - spec/dummy/test/controllers/.keep
230
+ - spec/dummy/test/fixtures/.keep
231
+ - spec/dummy/test/helpers/.keep
232
+ - spec/dummy/test/integration/.keep
233
+ - spec/dummy/test/mailers/.keep
234
+ - spec/dummy/test/models/.keep
235
+ - spec/dummy/test/test_helper.rb
236
+ - spec/dummy/vendor/assets/javascripts/.keep
237
+ - spec/dummy/vendor/assets/stylesheets/.keep
238
+ - spec/instance_spec.rb
239
+ - spec/related_spec.rb
240
+ - spec/spec_helper.rb