markable 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/README.md +199 -0
  2. data/Rakefile +38 -0
  3. data/lib/generators/markable/migration/migration_generator.rb +39 -0
  4. data/lib/generators/markable/migration/templates/active_record/migration.rb +17 -0
  5. data/lib/markable.rb +95 -0
  6. data/lib/markable/acts_as_markable.rb +155 -0
  7. data/lib/markable/acts_as_marker.rb +62 -0
  8. data/lib/markable/exceptions.rb +7 -0
  9. data/lib/markable/version.rb +3 -0
  10. data/lib/models/mark.rb +6 -0
  11. data/test/acts_as_markable_test.rb +219 -0
  12. data/test/acts_as_marker_test.rb +165 -0
  13. data/test/dummy/README.rdoc +261 -0
  14. data/test/dummy/Rakefile +7 -0
  15. data/test/dummy/app/assets/javascripts/application.js +15 -0
  16. data/test/dummy/app/assets/stylesheets/application.css +13 -0
  17. data/test/dummy/app/controllers/application_controller.rb +3 -0
  18. data/test/dummy/app/helpers/application_helper.rb +2 -0
  19. data/test/dummy/app/models/admin.rb +4 -0
  20. data/test/dummy/app/models/drink.rb +3 -0
  21. data/test/dummy/app/models/food.rb +4 -0
  22. data/test/dummy/app/models/user.rb +4 -0
  23. data/test/dummy/app/views/layouts/application.html.erb +14 -0
  24. data/test/dummy/config.ru +4 -0
  25. data/test/dummy/config/application.rb +56 -0
  26. data/test/dummy/config/boot.rb +10 -0
  27. data/test/dummy/config/database.yml +25 -0
  28. data/test/dummy/config/environment.rb +5 -0
  29. data/test/dummy/config/environments/development.rb +37 -0
  30. data/test/dummy/config/environments/production.rb +67 -0
  31. data/test/dummy/config/environments/test.rb +37 -0
  32. data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  33. data/test/dummy/config/initializers/inflections.rb +15 -0
  34. data/test/dummy/config/initializers/mime_types.rb +5 -0
  35. data/test/dummy/config/initializers/secret_token.rb +7 -0
  36. data/test/dummy/config/initializers/session_store.rb +8 -0
  37. data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  38. data/test/dummy/config/locales/en.yml +5 -0
  39. data/test/dummy/config/routes.rb +58 -0
  40. data/test/dummy/db/development.sqlite3 +0 -0
  41. data/test/dummy/db/migrate/20120214103734_create_users.rb +9 -0
  42. data/test/dummy/db/migrate/20120214103741_create_admins.rb +9 -0
  43. data/test/dummy/db/migrate/20120214105411_create_foods.rb +9 -0
  44. data/test/dummy/db/migrate/20120214105421_create_drinks.rb +9 -0
  45. data/test/dummy/db/migrate/20120214114957_markable_migration.rb +17 -0
  46. data/test/dummy/db/production.sqlite3 +0 -0
  47. data/test/dummy/db/schema.rb +52 -0
  48. data/test/dummy/db/test.sqlite3 +0 -0
  49. data/test/dummy/log/development.log +134 -0
  50. data/test/dummy/log/production.log +0 -0
  51. data/test/dummy/log/test.log +93646 -0
  52. data/test/dummy/public/404.html +26 -0
  53. data/test/dummy/public/422.html +26 -0
  54. data/test/dummy/public/500.html +25 -0
  55. data/test/dummy/public/favicon.ico +0 -0
  56. data/test/dummy/script/rails +6 -0
  57. data/test/dummy/test/fixtures/admins.yml +7 -0
  58. data/test/dummy/test/fixtures/drinks.yml +7 -0
  59. data/test/dummy/test/fixtures/foods.yml +7 -0
  60. data/test/dummy/test/fixtures/users.yml +7 -0
  61. data/test/dummy/test/unit/admin_test.rb +7 -0
  62. data/test/dummy/test/unit/drink_test.rb +7 -0
  63. data/test/dummy/test/unit/food_test.rb +7 -0
  64. data/test/dummy/test/unit/user_test.rb +7 -0
  65. data/test/support/get.rb +8 -0
  66. data/test/test_helper.rb +10 -0
  67. metadata +196 -0
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,25 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
File without changes
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,7 @@
1
+ # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
2
+
3
+ one:
4
+ name: MyString
5
+
6
+ two:
7
+ name: MyString
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class AdminTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class DrinkTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class FoodTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class UserTest < ActiveSupport::TestCase
4
+ # test "the truth" do
5
+ # assert true
6
+ # end
7
+ end
@@ -0,0 +1,8 @@
1
+ def get(model, n = 1)
2
+ result = []
3
+ n.times do
4
+ result.push model.create
5
+ end
6
+ return result.count > 1 ? result : result[0]
7
+ end
8
+
@@ -0,0 +1,10 @@
1
+ # Configure Rails Environment
2
+ ENV["RAILS_ENV"] = "test"
3
+
4
+ require File.expand_path("../dummy/config/environment.rb", __FILE__)
5
+ require "rails/test_help"
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
metadata ADDED
@@ -0,0 +1,196 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: markable
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.4
6
+ platform: ruby
7
+ authors:
8
+ - Alex Chrome
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2012-02-24 00:00:00 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rails
17
+ prerelease: false
18
+ requirement: &id001 !ruby/object:Gem::Requirement
19
+ none: false
20
+ requirements:
21
+ - - ~>
22
+ - !ruby/object:Gem::Version
23
+ version: "3.1"
24
+ type: :runtime
25
+ version_requirements: *id001
26
+ - !ruby/object:Gem::Dependency
27
+ name: sqlite3
28
+ prerelease: false
29
+ requirement: &id002 !ruby/object:Gem::Requirement
30
+ none: false
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: "0"
35
+ type: :development
36
+ version_requirements: *id002
37
+ description: Markable allows you to easily create a marking system in your rails application.
38
+ email:
39
+ - dify.chrome@gmail.com
40
+ executables: []
41
+
42
+ extensions: []
43
+
44
+ extra_rdoc_files: []
45
+
46
+ files:
47
+ - lib/generators/markable/migration/migration_generator.rb
48
+ - lib/generators/markable/migration/templates/active_record/migration.rb
49
+ - lib/markable/acts_as_markable.rb
50
+ - lib/markable/acts_as_marker.rb
51
+ - lib/markable/exceptions.rb
52
+ - lib/markable/version.rb
53
+ - lib/markable.rb
54
+ - lib/models/mark.rb
55
+ - Rakefile
56
+ - README.md
57
+ - test/acts_as_markable_test.rb
58
+ - test/acts_as_marker_test.rb
59
+ - test/dummy/app/assets/javascripts/application.js
60
+ - test/dummy/app/assets/stylesheets/application.css
61
+ - test/dummy/app/controllers/application_controller.rb
62
+ - test/dummy/app/helpers/application_helper.rb
63
+ - test/dummy/app/models/admin.rb
64
+ - test/dummy/app/models/drink.rb
65
+ - test/dummy/app/models/food.rb
66
+ - test/dummy/app/models/user.rb
67
+ - test/dummy/app/views/layouts/application.html.erb
68
+ - test/dummy/config/application.rb
69
+ - test/dummy/config/boot.rb
70
+ - test/dummy/config/database.yml
71
+ - test/dummy/config/environment.rb
72
+ - test/dummy/config/environments/development.rb
73
+ - test/dummy/config/environments/production.rb
74
+ - test/dummy/config/environments/test.rb
75
+ - test/dummy/config/initializers/backtrace_silencers.rb
76
+ - test/dummy/config/initializers/inflections.rb
77
+ - test/dummy/config/initializers/mime_types.rb
78
+ - test/dummy/config/initializers/secret_token.rb
79
+ - test/dummy/config/initializers/session_store.rb
80
+ - test/dummy/config/initializers/wrap_parameters.rb
81
+ - test/dummy/config/locales/en.yml
82
+ - test/dummy/config/routes.rb
83
+ - test/dummy/config.ru
84
+ - test/dummy/db/development.sqlite3
85
+ - test/dummy/db/migrate/20120214103734_create_users.rb
86
+ - test/dummy/db/migrate/20120214103741_create_admins.rb
87
+ - test/dummy/db/migrate/20120214105411_create_foods.rb
88
+ - test/dummy/db/migrate/20120214105421_create_drinks.rb
89
+ - test/dummy/db/migrate/20120214114957_markable_migration.rb
90
+ - test/dummy/db/production.sqlite3
91
+ - test/dummy/db/schema.rb
92
+ - test/dummy/db/test.sqlite3
93
+ - test/dummy/log/development.log
94
+ - test/dummy/log/production.log
95
+ - test/dummy/log/test.log
96
+ - test/dummy/public/404.html
97
+ - test/dummy/public/422.html
98
+ - test/dummy/public/500.html
99
+ - test/dummy/public/favicon.ico
100
+ - test/dummy/Rakefile
101
+ - test/dummy/README.rdoc
102
+ - test/dummy/script/rails
103
+ - test/dummy/test/fixtures/admins.yml
104
+ - test/dummy/test/fixtures/drinks.yml
105
+ - test/dummy/test/fixtures/foods.yml
106
+ - test/dummy/test/fixtures/users.yml
107
+ - test/dummy/test/unit/admin_test.rb
108
+ - test/dummy/test/unit/drink_test.rb
109
+ - test/dummy/test/unit/food_test.rb
110
+ - test/dummy/test/unit/user_test.rb
111
+ - test/support/get.rb
112
+ - test/test_helper.rb
113
+ homepage: https://github.com/chrome/markable
114
+ licenses: []
115
+
116
+ post_install_message:
117
+ rdoc_options: []
118
+
119
+ require_paths:
120
+ - lib
121
+ required_ruby_version: !ruby/object:Gem::Requirement
122
+ none: false
123
+ requirements:
124
+ - - ">="
125
+ - !ruby/object:Gem::Version
126
+ version: "0"
127
+ required_rubygems_version: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: "0"
133
+ requirements: []
134
+
135
+ rubyforge_project:
136
+ rubygems_version: 1.8.5
137
+ signing_key:
138
+ specification_version: 3
139
+ summary: Marking system for rails app
140
+ test_files:
141
+ - test/acts_as_markable_test.rb
142
+ - test/acts_as_marker_test.rb
143
+ - test/dummy/app/assets/javascripts/application.js
144
+ - test/dummy/app/assets/stylesheets/application.css
145
+ - test/dummy/app/controllers/application_controller.rb
146
+ - test/dummy/app/helpers/application_helper.rb
147
+ - test/dummy/app/models/admin.rb
148
+ - test/dummy/app/models/drink.rb
149
+ - test/dummy/app/models/food.rb
150
+ - test/dummy/app/models/user.rb
151
+ - test/dummy/app/views/layouts/application.html.erb
152
+ - test/dummy/config/application.rb
153
+ - test/dummy/config/boot.rb
154
+ - test/dummy/config/database.yml
155
+ - test/dummy/config/environment.rb
156
+ - test/dummy/config/environments/development.rb
157
+ - test/dummy/config/environments/production.rb
158
+ - test/dummy/config/environments/test.rb
159
+ - test/dummy/config/initializers/backtrace_silencers.rb
160
+ - test/dummy/config/initializers/inflections.rb
161
+ - test/dummy/config/initializers/mime_types.rb
162
+ - test/dummy/config/initializers/secret_token.rb
163
+ - test/dummy/config/initializers/session_store.rb
164
+ - test/dummy/config/initializers/wrap_parameters.rb
165
+ - test/dummy/config/locales/en.yml
166
+ - test/dummy/config/routes.rb
167
+ - test/dummy/config.ru
168
+ - test/dummy/db/development.sqlite3
169
+ - test/dummy/db/migrate/20120214103734_create_users.rb
170
+ - test/dummy/db/migrate/20120214103741_create_admins.rb
171
+ - test/dummy/db/migrate/20120214105411_create_foods.rb
172
+ - test/dummy/db/migrate/20120214105421_create_drinks.rb
173
+ - test/dummy/db/migrate/20120214114957_markable_migration.rb
174
+ - test/dummy/db/production.sqlite3
175
+ - test/dummy/db/schema.rb
176
+ - test/dummy/db/test.sqlite3
177
+ - test/dummy/log/development.log
178
+ - test/dummy/log/production.log
179
+ - test/dummy/log/test.log
180
+ - test/dummy/public/404.html
181
+ - test/dummy/public/422.html
182
+ - test/dummy/public/500.html
183
+ - test/dummy/public/favicon.ico
184
+ - test/dummy/Rakefile
185
+ - test/dummy/README.rdoc
186
+ - test/dummy/script/rails
187
+ - test/dummy/test/fixtures/admins.yml
188
+ - test/dummy/test/fixtures/drinks.yml
189
+ - test/dummy/test/fixtures/foods.yml
190
+ - test/dummy/test/fixtures/users.yml
191
+ - test/dummy/test/unit/admin_test.rb
192
+ - test/dummy/test/unit/drink_test.rb
193
+ - test/dummy/test/unit/food_test.rb
194
+ - test/dummy/test/unit/user_test.rb
195
+ - test/support/get.rb
196
+ - test/test_helper.rb