clipster 0.3.0 → 0.4.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.
Files changed (57) hide show
  1. data/MIT-LICENSE +20 -20
  2. data/README.md +72 -0
  3. data/Rakefile +34 -34
  4. data/app/assets/images/clipster/rss_logo_small.png +0 -0
  5. data/app/assets/javascripts/clipster/application.js +15 -15
  6. data/app/assets/javascripts/clipster/bootstrap.js +2026 -2026
  7. data/app/assets/javascripts/clipster/bootstrap.min.js +5 -5
  8. data/app/assets/javascripts/clipster/clip.js +2 -2
  9. data/app/assets/javascripts/clipster/clips.js +7 -2
  10. data/app/assets/javascripts/clipster/users.js +2 -0
  11. data/app/assets/stylesheets/clipster/application.css +27 -27
  12. data/app/assets/stylesheets/clipster/bootstrap.css +5774 -5774
  13. data/app/assets/stylesheets/clipster/clip.css +31 -21
  14. data/app/assets/stylesheets/clipster/clips.css +4 -4
  15. data/app/assets/stylesheets/clipster/users.css +4 -0
  16. data/app/controllers/clipster/application_controller.rb +14 -7
  17. data/app/controllers/clipster/clips_controller.rb +86 -80
  18. data/app/controllers/clipster/users_controller.rb +17 -0
  19. data/app/helpers/clipster/application_helper.rb +19 -4
  20. data/app/helpers/clipster/clip_helper.rb +4 -4
  21. data/app/helpers/clipster/clips_helper.rb +4 -4
  22. data/app/helpers/clipster/users_helper.rb +4 -0
  23. data/app/models/clipster/clip.rb +99 -74
  24. data/app/views/clipster/clips/about.html.erb +14 -14
  25. data/app/views/clipster/clips/create.html.erb +56 -46
  26. data/app/views/clipster/clips/list.atom.builder +22 -0
  27. data/app/views/clipster/clips/list.html.erb +60 -43
  28. data/app/views/clipster/clips/show.html.erb +8 -8
  29. data/app/views/clipster/users/index.html.erb +2 -0
  30. data/app/views/clipster/users/show.html.erb +46 -0
  31. data/app/views/kaminari/_first_page.html.erb +3 -3
  32. data/app/views/kaminari/_gap.html.erb +3 -3
  33. data/app/views/kaminari/_last_page.html.erb +3 -3
  34. data/app/views/kaminari/_next_page.html.erb +3 -3
  35. data/app/views/kaminari/_page.html.erb +3 -3
  36. data/app/views/kaminari/_paginator.html.erb +17 -17
  37. data/app/views/kaminari/_prev_page.html.erb +3 -3
  38. data/app/views/layouts/clipster/application.html.erb +62 -49
  39. data/config/routes.rb +16 -14
  40. data/config/schedule.rb +10 -10
  41. data/db/migrate/20121004010757_create_clipster_clips.rb +16 -16
  42. data/db/migrate/20121007154400_add_hash_index_to_clips.rb +13 -13
  43. data/db/migrate/20121007155125_populate_clip_defaults.rb +21 -21
  44. data/db/migrate/20121007162741_rename_hash_to_url_hash.rb +9 -9
  45. data/db/migrate/20121007223358_remove_default_from_language.rb +9 -9
  46. data/db/migrate/20121007223631_set_default_title_to_untitled.rb +9 -9
  47. data/db/migrate/20121105212724_add_lifespan_to_clips.rb +9 -9
  48. data/db/migrate/20121114175749_add_user_id_to_clips.rb +9 -0
  49. data/lib/clipster/configuration.rb +23 -0
  50. data/lib/clipster/engine.rb +23 -15
  51. data/lib/clipster/version.rb +3 -3
  52. data/lib/clipster.rb +5 -4
  53. data/lib/generators/clipster/install_generator.rb +19 -0
  54. data/lib/generators/templates/clipster.rb +12 -0
  55. data/lib/tasks/clipster_tasks.rake +4 -4
  56. metadata +16 -4
  57. data/README.rdoc +0 -54
@@ -0,0 +1,23 @@
1
+ module Clipster
2
+ class Configuration
3
+ attr_accessor :user_class
4
+ attr_accessor :associates_clip_with_user
5
+ attr_accessor :user_display_attribute
6
+
7
+ def associates_clip_with_user
8
+ @associates_clip_with_user || false
9
+ end
10
+
11
+ def user_class
12
+ @user_class.constantize || "User".constantize
13
+ end
14
+
15
+ def user_class=(user_class)
16
+ @user_class = user_class
17
+ end
18
+
19
+ def user_display_attribute
20
+ @user_display_attribute || "email"
21
+ end
22
+ end
23
+ end
@@ -1,15 +1,23 @@
1
- require 'coderay'
2
- require 'dynamic_form'
3
- require 'kaminari'
4
-
5
- module Clipster
6
- class Engine < ::Rails::Engine
7
- isolate_namespace Clipster
8
-
9
- # so we can use rspec generators
10
- config.generators do |g|
11
- g.test_framework :rspec
12
- g.integration_tool :rspec
13
- end
14
- end
15
- end
1
+ require 'coderay'
2
+ require 'dynamic_form'
3
+ require 'kaminari'
4
+
5
+ module Clipster
6
+ class Engine < ::Rails::Engine
7
+ isolate_namespace Clipster
8
+
9
+ # so we can use rspec generators
10
+ config.generators do |g|
11
+ g.test_framework :rspec
12
+ g.integration_tool :rspec
13
+ end
14
+ end
15
+
16
+ def self.config (&block)
17
+ @@config ||= Clipster::Configuration.new
18
+
19
+ yield @@config if block
20
+
21
+ return @@config
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
- module Clipster
2
- VERSION = "0.3.0"
3
- end
1
+ module Clipster
2
+ VERSION = "0.4.0"
3
+ end
data/lib/clipster.rb CHANGED
@@ -1,4 +1,5 @@
1
- require "clipster/engine"
2
-
3
- module Clipster
4
- end
1
+ require "clipster/engine"
2
+ require "clipster/configuration"
3
+ module Clipster
4
+
5
+ end
@@ -0,0 +1,19 @@
1
+ #!/usr/bin/env rake
2
+ module Clipster
3
+ module Generators
4
+ class InstallGenerator < Rails::Generators::Base
5
+ source_root File.expand_path("../../templates", __FILE__)
6
+
7
+ desc "Creates a Clipster initializer and copies it to your application"
8
+
9
+ def copy_initializer
10
+ template "clipster.rb", "config/initializers/clipster.rb"
11
+ end
12
+
13
+ def copy_migrations
14
+ rake("clipster:install:migrations")
15
+ end
16
+
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,12 @@
1
+ Clipster.config do |config|
2
+ # Specify the user class as a string
3
+ # This is set to User by default
4
+ #config.user_class = "User"
5
+
6
+ # If you would like to turn on User associations uncomment the following line
7
+ # This will save the user id with clips to allow for user analytics
8
+ #config.associates_clip_with_user = true
9
+
10
+ # Change this line to the attribute you would like to be displayed for the User model
11
+ #config.user_display_attribute = "email"
12
+ end
@@ -1,4 +1,4 @@
1
- # desc "Explaining what the task does"
2
- # task :clipster do
3
- # # Task goes here
4
- # end
1
+ # desc "Explaining what the task does"
2
+ # task :clipster do
3
+ # # Task goes here
4
+ # end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clipster
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-11-08 00:00:00.000000000 Z
13
+ date: 2012-11-21 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -149,26 +149,34 @@ extra_rdoc_files: []
149
149
  files:
150
150
  - app/assets/images/clipster/glyphicons-halflings-white.png
151
151
  - app/assets/images/clipster/glyphicons-halflings.png
152
+ - app/assets/images/clipster/rss_logo_small.png
152
153
  - app/assets/javascripts/clipster/application.js
153
154
  - app/assets/javascripts/clipster/bootstrap.js
154
155
  - app/assets/javascripts/clipster/bootstrap.min.js
155
156
  - app/assets/javascripts/clipster/clip.js
156
157
  - app/assets/javascripts/clipster/clips.js
158
+ - app/assets/javascripts/clipster/users.js
157
159
  - app/assets/stylesheets/clipster/application.css
158
160
  - app/assets/stylesheets/clipster/bootstrap.css
159
161
  - app/assets/stylesheets/clipster/clip.css
160
162
  - app/assets/stylesheets/clipster/clips.css
163
+ - app/assets/stylesheets/clipster/users.css
161
164
  - app/controllers/clipster/application_controller.rb
162
165
  - app/controllers/clipster/clips_controller.rb
166
+ - app/controllers/clipster/users_controller.rb
163
167
  - app/helpers/clipster/application_helper.rb
164
- - app/helpers/clipster/clips_helper.rb
165
168
  - app/helpers/clipster/clip_helper.rb
169
+ - app/helpers/clipster/clips_helper.rb
170
+ - app/helpers/clipster/users_helper.rb
166
171
  - app/models/clipster/clip.rb
167
172
  - app/views/clipster/clips/about.html.erb
168
173
  - app/views/clipster/clips/create.html.erb
169
174
  - app/views/clipster/clips/expired.html.erb
175
+ - app/views/clipster/clips/list.atom.builder
170
176
  - app/views/clipster/clips/list.html.erb
171
177
  - app/views/clipster/clips/show.html.erb
178
+ - app/views/clipster/users/index.html.erb
179
+ - app/views/clipster/users/show.html.erb
172
180
  - app/views/kaminari/_first_page.html.erb
173
181
  - app/views/kaminari/_gap.html.erb
174
182
  - app/views/kaminari/_last_page.html.erb
@@ -186,13 +194,17 @@ files:
186
194
  - db/migrate/20121007223358_remove_default_from_language.rb
187
195
  - db/migrate/20121007223631_set_default_title_to_untitled.rb
188
196
  - db/migrate/20121105212724_add_lifespan_to_clips.rb
197
+ - db/migrate/20121114175749_add_user_id_to_clips.rb
198
+ - lib/clipster/configuration.rb
189
199
  - lib/clipster/engine.rb
190
200
  - lib/clipster/version.rb
191
201
  - lib/clipster.rb
202
+ - lib/generators/clipster/install_generator.rb
203
+ - lib/generators/templates/clipster.rb
192
204
  - lib/tasks/clipster_tasks.rake
193
205
  - MIT-LICENSE
194
206
  - Rakefile
195
- - README.rdoc
207
+ - README.md
196
208
  homepage: http://github.com/kwbock/clipster
197
209
  licenses: []
198
210
  post_install_message:
data/README.rdoc DELETED
@@ -1,54 +0,0 @@
1
- = Clipster
2
-
3
- {<img src="https://secure.travis-ci.org/kwbock/clipster.png" alt="Build Status" />}[http://travis-ci.org/kwbock/clipster]
4
-
5
- Code snippets before they were cool.
6
-
7
- An OpenSource Rails engine to add clipboard code sharing to your existing Ruby on Rails applications. Great for internal code sharing.
8
-
9
- == Production
10
-
11
- Add clipster to your Gemfile and then bundle install
12
-
13
- gem 'clipster'
14
- bundle install
15
-
16
- or if you aren't using Bundler, run
17
-
18
- gem install 'clipster'
19
-
20
- Mount the Clipster Engine in your applcations routes.rb like follows.
21
-
22
- mount Clipster::Engine, :at => '/clipster'
23
-
24
- cd to your apps root and run
25
-
26
- rake clipster:install:migrations && rake db:migrate
27
-
28
- Restart your application and you should be able to access the engine at http://domain.tld/clipster
29
-
30
- == Development
31
-
32
- cd into your test application directory's lib folder and run the following
33
-
34
- git clone https://github.com/kwbock/clipster.git
35
-
36
- Add the following to your app's Gemfile
37
-
38
- gem 'clipster', :path => './lib/clipster'
39
-
40
- Add the following to your app's routes.rb
41
-
42
- mount Clipster::Engine, :at => '/clipster'
43
-
44
- cd to your apps root and run
45
-
46
- rake clipster:install:migrations
47
- rake db:migrate
48
-
49
- Launch your server and navigate to https://localhost:3000/clipster to confirm the engine was mounted correctly
50
-
51
-
52
- === Todos
53
-
54
- Look into adding authentication and user role handling, specifically the ability to tie clips to users. (targetting devise first)