clipster 0.4.0 → 0.4.1

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 +76 -72
  3. data/Rakefile +34 -34
  4. data/app/assets/javascripts/clipster/application.js +15 -15
  5. data/app/assets/javascripts/clipster/bootstrap.js +2026 -2026
  6. data/app/assets/javascripts/clipster/bootstrap.min.js +5 -5
  7. data/app/assets/javascripts/clipster/clip.js +2 -2
  8. data/app/assets/javascripts/clipster/clips.js +6 -6
  9. data/app/assets/javascripts/clipster/users.js +2 -2
  10. data/app/assets/stylesheets/clipster/application.css +27 -27
  11. data/app/assets/stylesheets/clipster/bootstrap.css +5774 -5774
  12. data/app/assets/stylesheets/clipster/clip.css +31 -31
  13. data/app/assets/stylesheets/clipster/clips.css +4 -4
  14. data/app/assets/stylesheets/clipster/users.css +4 -4
  15. data/app/controllers/clipster/application_controller.rb +14 -14
  16. data/app/controllers/clipster/clips_controller.rb +86 -86
  17. data/app/controllers/clipster/users_controller.rb +17 -17
  18. data/app/helpers/clipster/application_helper.rb +19 -19
  19. data/app/helpers/clipster/clip_helper.rb +4 -4
  20. data/app/helpers/clipster/clips_helper.rb +4 -4
  21. data/app/helpers/clipster/users_helper.rb +4 -4
  22. data/app/models/clipster/clip.rb +97 -99
  23. data/app/views/clipster/clips/about.html.erb +14 -14
  24. data/app/views/clipster/clips/create.html.erb +56 -56
  25. data/app/views/clipster/clips/list.atom.builder +21 -21
  26. data/app/views/clipster/clips/list.html.erb +60 -60
  27. data/app/views/clipster/clips/show.html.erb +8 -8
  28. data/app/views/clipster/users/index.html.erb +2 -2
  29. data/app/views/clipster/users/show.html.erb +45 -45
  30. data/app/views/kaminari/_first_page.html.erb +3 -3
  31. data/app/views/kaminari/_gap.html.erb +3 -3
  32. data/app/views/kaminari/_last_page.html.erb +3 -3
  33. data/app/views/kaminari/_next_page.html.erb +3 -3
  34. data/app/views/kaminari/_page.html.erb +3 -3
  35. data/app/views/kaminari/_paginator.html.erb +17 -17
  36. data/app/views/kaminari/_prev_page.html.erb +3 -3
  37. data/app/views/layouts/clipster/application.html.erb +62 -62
  38. data/config/initializers/clipster.rb +12 -0
  39. data/config/routes.rb +16 -16
  40. data/config/schedule.rb +10 -10
  41. data/db/migrate/20121126185058_create_clipster_clips.rb +18 -0
  42. data/lib/clipster.rb +5 -5
  43. data/lib/clipster/configuration.rb +22 -22
  44. data/lib/clipster/engine.rb +23 -23
  45. data/lib/clipster/version.rb +3 -3
  46. data/lib/generators/clipster/install_generator.rb +19 -19
  47. data/lib/generators/templates/clipster.rb +12 -12
  48. data/lib/tasks/clipster_tasks.rake +4 -4
  49. metadata +5 -11
  50. data/db/migrate/20121004010757_create_clipster_clips.rb +0 -16
  51. data/db/migrate/20121007154400_add_hash_index_to_clips.rb +0 -13
  52. data/db/migrate/20121007155125_populate_clip_defaults.rb +0 -21
  53. data/db/migrate/20121007162741_rename_hash_to_url_hash.rb +0 -9
  54. data/db/migrate/20121007223358_remove_default_from_language.rb +0 -9
  55. data/db/migrate/20121007223631_set_default_title_to_untitled.rb +0 -9
  56. data/db/migrate/20121105212724_add_lifespan_to_clips.rb +0 -9
  57. data/db/migrate/20121114175749_add_user_id_to_clips.rb +0 -9
@@ -1,15 +1,15 @@
1
- <legend>About Clipster v.<%=Clipster::VERSION%></legend>
2
-
3
- <div class="span10 offset1">
4
- <p>Clipster is an Open Source Rails engine to add clipboard code sharing to your existing Ruby on Rails applications. Complete with syntax highlighting and expiring clips, its great for internal code sharing. Please visit us on <%= link_to("GitHub", "http://github.com/kwbock/clipster") %> for downloads and support.</p>
5
- </div>
6
-
7
- <div class="well span9 offset1">
8
- <p>Copyright 2012 Kyle Bock, Daniel White</p>
9
-
10
- <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
11
-
12
- <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<p>
13
-
14
- <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
1
+ <legend>About Clipster v<%=Gem.searcher.find("clipster").version unless Gem.searcher.find("clipster").nil?%></legend>
2
+
3
+ <div class="span10 offset1">
4
+ <p>Clipster is an Open Source Rails engine to add clipboard code sharing to your existing Ruby on Rails applications. Complete with syntax highlighting and expiring clips, its great for internal code sharing. Please visit us on <%= link_to("GitHub", "http://github.com/kwbock/clipster") %> for downloads and support.</p>
5
+ </div>
6
+
7
+ <div class="well span9 offset1">
8
+ <p>Copyright 2012 Kyle Bock, Daniel White</p>
9
+
10
+ <p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p>
11
+
12
+ <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<p>
13
+
14
+ <p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
15
15
  </div>
@@ -1,57 +1,57 @@
1
- <legend>New Clip</legend>
2
-
3
- <%= form_for(@clip, :url => { :action => "create" }) do |f| %>
4
- <%= f.error_messages %>
5
-
6
- <!-- 1st Row -->
7
- <div class="span5 offset1">
8
- <!-- title -->
9
- <div class="span4 no-left">
10
- <div class="help-tip">
11
- <%= f.label(:title) %> <i class="icon-question-sign" data-title="Name your clip"></i></div>
12
- <%= f.text_field(:title, :value => @clip.title, :required=>"required") %>
13
- </div>
14
- <!-- /title -->
15
-
16
- <!-- language -->
17
- <div class="span4 no-left">
18
- <div class="help-tip">
19
- <%= f.label(:language) %> <i class="icon-question-sign" data-title="Choose a language for syntax highlighting"></i></div>
20
- <%= f.collection_select("language", @languages, :lang, :title, :selected => (@clip.language || "text")) %>
21
- </div>
22
- <!-- /language -->
23
- </div>
24
- <!-- /1st Row -->
25
-
26
- <!-- 2nd Row -->
27
- <div class="span5 offset1 pull-right no-left">
28
- <!-- lifespan -->
29
- <div class="span4">
30
- <div class="help-tip">
31
- <%= f.label(:lifespan) %> <i class="icon-question-sign" data-title="Choose how long the clip should remain available"></i></div>
32
- <%= f.select(:lifespan, @clip.lifespans, :selected=>(@clip.lifespan || "Forever")) %>
33
- </div>
34
- <!-- /lifespan -->
35
-
36
- <!-- private -->
37
- <div class="span4">
38
- <div class="help-tip">
39
- <%= f.label(:private) %> <i class="icon-question-sign" data-title="Only allow those with a link to access the clip"></i></div>
40
- <%= f.check_box(:private, :value => @clip.private) %>
41
- </div>
42
- <!-- /private -->
43
- </div>
44
- <!-- /2nd Row -->
45
-
46
- <!-- clip -->
47
- <div class="span10 offset1">
48
- <div class="help-tip">
49
- <%= f.label(:clip) %> <i class="icon-question-sign" data-title="The main content to be shared"></i></div>
50
- <%= f.text_area(:clip, :class=>"span10", :rows=>"15", :value => @clip.clip, :required=>"required") %>
51
- </div>
52
- <!-- /clip -->
53
-
54
- <div class="span2 pull-right">
55
- <%= f.submit(:class=>"btn btn-primary") %>
56
- </div>
1
+ <legend>New Clip</legend>
2
+
3
+ <%= form_for(@clip, :url => { :action => "create" }) do |f| %>
4
+ <%= f.error_messages %>
5
+
6
+ <!-- 1st Row -->
7
+ <div class="span5 offset1">
8
+ <!-- title -->
9
+ <div class="span4 no-left">
10
+ <div class="help-tip">
11
+ <%= f.label(:title) %> <i class="icon-question-sign" data-title="Name your clip"></i></div>
12
+ <%= f.text_field(:title, :value => @clip.title, :required=>"required") %>
13
+ </div>
14
+ <!-- /title -->
15
+
16
+ <!-- language -->
17
+ <div class="span4 no-left">
18
+ <div class="help-tip">
19
+ <%= f.label(:language) %> <i class="icon-question-sign" data-title="Choose a language for syntax highlighting"></i></div>
20
+ <%= f.collection_select("language", @languages, :lang, :title, :selected => (@clip.language || "text")) %>
21
+ </div>
22
+ <!-- /language -->
23
+ </div>
24
+ <!-- /1st Row -->
25
+
26
+ <!-- 2nd Row -->
27
+ <div class="span5 offset1 pull-right no-left">
28
+ <!-- lifespan -->
29
+ <div class="span4">
30
+ <div class="help-tip">
31
+ <%= f.label(:lifespan) %> <i class="icon-question-sign" data-title="Choose how long the clip should remain available"></i></div>
32
+ <%= f.select(:lifespan, @clip.lifespans, :selected=>(@clip.lifespan || "Forever")) %>
33
+ </div>
34
+ <!-- /lifespan -->
35
+
36
+ <!-- private -->
37
+ <div class="span4">
38
+ <div class="help-tip">
39
+ <%= f.label(:private) %> <i class="icon-question-sign" data-title="Only allow those with a link to access the clip"></i></div>
40
+ <%= f.check_box(:private, :value => @clip.private) %>
41
+ </div>
42
+ <!-- /private -->
43
+ </div>
44
+ <!-- /2nd Row -->
45
+
46
+ <!-- clip -->
47
+ <div class="span10 offset1">
48
+ <div class="help-tip">
49
+ <%= f.label(:clip) %> <i class="icon-question-sign" data-title="The main content to be shared"></i></div>
50
+ <%= f.text_area(:clip, :class=>"span10", :rows=>"15", :value => @clip.clip, :required=>"required") %>
51
+ </div>
52
+ <!-- /clip -->
53
+
54
+ <div class="span2 pull-right">
55
+ <%= f.submit(:class=>"btn btn-primary") %>
56
+ </div>
57
57
  <% end %>
@@ -1,22 +1,22 @@
1
- atom_feed do |feed|
2
- feed.title("Clipster - Recent")
3
- feed.updated(@updated_at) unless @updated_at.nil?
4
-
5
- @clips.each do |clip|
6
- feed.entry(clip) do |entry|
7
- entry.title(clip.title)
8
- if clip.expires.nil?
9
- entry.subtitle("A #{clip.language} clip that never expires")
10
- else
11
- entry.subtitle("A #{clip.language} clip that expires on #{clip.expires}")
12
- end
13
- entry.updated(clip.updated_at)
14
- entry.content(clip.div.html_safe, :type => 'html')
15
-
16
- #TODO set author once user integration is compleate
17
- #entry.author do |author|
18
- # author.name("DHH")
19
- #end
20
- end
21
- end
1
+ atom_feed do |feed|
2
+ feed.title("Clipster - Recent")
3
+ feed.updated(@updated_at) unless @updated_at.nil?
4
+
5
+ @clips.each do |clip|
6
+ feed.entry(clip) do |entry|
7
+ entry.title(clip.title)
8
+ if clip.expires.nil?
9
+ entry.subtitle("A #{clip.language} clip that never expires")
10
+ else
11
+ entry.subtitle("A #{clip.language} clip that expires on #{clip.expires}")
12
+ end
13
+ entry.updated(clip.updated_at)
14
+ entry.content(clip.div.html_safe, :type => 'html')
15
+
16
+ #TODO set author once user integration is compleate
17
+ #entry.author do |author|
18
+ # author.name("DHH")
19
+ #end
20
+ end
21
+ end
22
22
  end
@@ -1,61 +1,61 @@
1
- <%= content_for :head, auto_discovery_link_tag(:atom) %>
2
-
3
- <legend>
4
- Recent Clips<%= " - #{params[:lang]}" unless params[:lang].nil? %>
5
- <%= link_to "", list_clips_path(:lang => params[:lang], :format=>:atom), :class=>"image-feed pull-right" %>
6
- </legend>
7
- <div class="span7">
8
- <table class="table table-striped table-bordered table-hover span6">
9
- <thead>
10
- <tr>
11
- <th>
12
- Title
13
- </th>
14
- <% if Clipster.config.associates_clip_with_user %>
15
- <th>
16
- User
17
- </th>
18
- <% end %>
19
- <th>
20
- Language
21
- </th>
22
- <th>
23
- Created On
24
- </th>
25
- <th>
26
- Expires
27
- </th>
28
- </tr>
29
- </thead>
30
- <tbody>
31
- <% @clips.each do |clip| %>
32
- <tr>
33
- <td><%= link_to clip.title, clip %></td>
34
- <% if Clipster.config.associates_clip_with_user %>
35
- <td>
36
- <%= link_to(display_user_text(clip.user), clip.user) if clip.user %>
37
- </td>
38
- <% end %>
39
- <td><%= clip.language.capitalize %></td>
40
- <td><%= l clip.created_at, :format => :short %></td>
41
- <td><%= clip.expires_in_words %></td>
42
- </tr>
43
- <% end %>
44
- <% unless @clips.length > 0 %>
45
- <tr>
46
- <td colspan="3" style="text-align: center;">There are no public clips.</td>
47
- </tr>
48
- <% end %>
49
- </tbody>
50
- </table>
51
- <div class="clearfix"></div>
52
- <%= paginate @clips %>
53
- </div>
54
-
55
- <%# Refactor out into common partial %>
56
- <aside class="languages bordered span3 offset1">
57
- <div class="title">Languages</div>
58
- <% get_language_counts.each do |lang| %>
59
- <div><%= link_to lang.language, list_clips_path(:lang => lang.language) %> (<%= lang.count %>)</div>
60
- <% end %>
1
+ <%= content_for :head, auto_discovery_link_tag(:atom) %>
2
+
3
+ <legend>
4
+ Recent Clips<%= " - #{params[:lang]}" unless params[:lang].nil? %>
5
+ <%= link_to "", list_clips_path(:lang => params[:lang], :format=>:atom), :class=>"image-feed pull-right" %>
6
+ </legend>
7
+ <div class="span7">
8
+ <table class="table table-striped table-bordered table-hover span6">
9
+ <thead>
10
+ <tr>
11
+ <th>
12
+ Title
13
+ </th>
14
+ <% if Clipster.config.associates_clip_with_user %>
15
+ <th>
16
+ User
17
+ </th>
18
+ <% end %>
19
+ <th>
20
+ Language
21
+ </th>
22
+ <th>
23
+ Created On
24
+ </th>
25
+ <th>
26
+ Expires
27
+ </th>
28
+ </tr>
29
+ </thead>
30
+ <tbody>
31
+ <% @clips.each do |clip| %>
32
+ <tr>
33
+ <td><%= link_to clip.title, clip %></td>
34
+ <% if Clipster.config.associates_clip_with_user %>
35
+ <td>
36
+ <%= link_to(display_user_text(clip.user), clip.user) if clip.user %>
37
+ </td>
38
+ <% end %>
39
+ <td><%= clip.language.capitalize %></td>
40
+ <td><%= l clip.created_at, :format => :short %></td>
41
+ <td><%= clip.expires_in_words %></td>
42
+ </tr>
43
+ <% end %>
44
+ <% unless @clips.length > 0 %>
45
+ <tr>
46
+ <td colspan="3" style="text-align: center;">There are no public clips.</td>
47
+ </tr>
48
+ <% end %>
49
+ </tbody>
50
+ </table>
51
+ <div class="clearfix"></div>
52
+ <%= paginate @clips %>
53
+ </div>
54
+
55
+ <%# Refactor out into common partial %>
56
+ <aside class="languages bordered span3 offset1">
57
+ <div class="title">Languages</div>
58
+ <% get_language_counts.each do |lang| %>
59
+ <div><%= link_to lang.language, list_clips_path(:lang => lang.language) %> (<%= lang.count %>)</div>
60
+ <% end %>
61
61
  </aside>
@@ -1,8 +1,8 @@
1
- <legend>
2
- <div class="span10"><%=@clip.title %></div>
3
- <div class="span3 secondary">A <%=@clip.language.capitalize %> clip</div>
4
- <div class="span5 secondary">Expires: <%= @clip.expires_in_words %></div>
5
- <div class="clearfix"></div>
6
- </legend>
7
- <div class="clearfix"></div>
8
- <%= @clip.div.html_safe %>
1
+ <legend>
2
+ <div class="span10"><%=@clip.title %></div>
3
+ <div class="span3 secondary">A <%=@clip.language.capitalize %> clip</div>
4
+ <div class="span5 secondary">Expires: <%= @clip.expires_in_words %></div>
5
+ <div class="clearfix"></div>
6
+ </legend>
7
+ <div class="clearfix"></div>
8
+ <%= @clip.div.html_safe %>
@@ -1,2 +1,2 @@
1
- <h1>Users#index</h1>
2
- <p>Find me in app/views/clipster/users/index.html.erb</p>
1
+ <h1>Users#index</h1>
2
+ <p>Find me in app/views/clipster/users/index.html.erb</p>
@@ -1,46 +1,46 @@
1
- <legend>Recent Clips from <%= @user %></legend>
2
- <div class="span7">
3
- <table class="table table-striped table-bordered table-hover span6">
4
- <thead>
5
- <tr>
6
- <th>
7
- Title
8
- </th>
9
- <th>
10
- Language
11
- </th>
12
- <th>
13
- Created On
14
- </th>
15
- <th>
16
- Expires
17
- </th>
18
- </tr>
19
- </thead>
20
- <tbody>
21
- <% @clips.each do |clip| %>
22
- <tr>
23
- <td><%= link_to clip.title, clip_path %></td>
24
- <td><%= clip.language.capitalize %></td>
25
- <td><%= l clip.created_at, :format => :short %></td>
26
- <td><%= clip.expires_in_words %></td>
27
- </tr>
28
- <% end %>
29
- <% unless @clips.length > 0 %>
30
- <tr>
31
- <td colspan="3" style="text-align: center;">There are no public clips.</td>
32
- </tr>
33
- <% end %>
34
- </tbody>
35
- </table>
36
- <div class="clearfix"></div>
37
- <%= paginate @clips %>
38
- </div>
39
-
40
- <%# Refactor out into common partial %>
41
- <aside class="languages bordered span3 offset1">
42
- <div class="title">Languages</div>
43
- <% get_language_counts.each do |lang| %>
44
- <div><%= link_to lang.language.capitalize, list_clips_path(:lang => lang.language) %> (<%= lang.count %>)</div>
45
- <% end %>
1
+ <legend>Recent Clips from <%= @user %></legend>
2
+ <div class="span7">
3
+ <table class="table table-striped table-bordered table-hover span6">
4
+ <thead>
5
+ <tr>
6
+ <th>
7
+ Title
8
+ </th>
9
+ <th>
10
+ Language
11
+ </th>
12
+ <th>
13
+ Created On
14
+ </th>
15
+ <th>
16
+ Expires
17
+ </th>
18
+ </tr>
19
+ </thead>
20
+ <tbody>
21
+ <% @clips.each do |clip| %>
22
+ <tr>
23
+ <td><%= link_to clip.title, clip_path %></td>
24
+ <td><%= clip.language.capitalize %></td>
25
+ <td><%= l clip.created_at, :format => :short %></td>
26
+ <td><%= clip.expires_in_words %></td>
27
+ </tr>
28
+ <% end %>
29
+ <% unless @clips.length > 0 %>
30
+ <tr>
31
+ <td colspan="3" style="text-align: center;">There are no public clips.</td>
32
+ </tr>
33
+ <% end %>
34
+ </tbody>
35
+ </table>
36
+ <div class="clearfix"></div>
37
+ <%= paginate @clips %>
38
+ </div>
39
+
40
+ <%# Refactor out into common partial %>
41
+ <aside class="languages bordered span3 offset1">
42
+ <div class="title">Languages</div>
43
+ <% get_language_counts.each do |lang| %>
44
+ <div><%= link_to lang.language.capitalize, list_clips_path(:lang => lang.language) %> (<%= lang.count %>)</div>
45
+ <% end %>
46
46
  </aside>
@@ -1,3 +1,3 @@
1
- <li>
2
- <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
3
- </li>
1
+ <li>
2
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
3
+ </li>
@@ -1,3 +1,3 @@
1
- <li class="disabled">
2
- <%= link_to raw(t 'views.pagination.truncate'), '#' %>
3
- </li>
1
+ <li class="disabled">
2
+ <%= link_to raw(t 'views.pagination.truncate'), '#' %>
3
+ </li>
@@ -1,3 +1,3 @@
1
- <li>
2
- <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
3
- </li>
1
+ <li>
2
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
3
+ </li>