clipster 0.2.2 → 0.3.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 (45) hide show
  1. data/MIT-LICENSE +20 -20
  2. data/README.rdoc +53 -52
  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 +2 -2
  9. data/app/assets/stylesheets/clipster/application.css +27 -15
  10. data/app/assets/stylesheets/clipster/bootstrap.css +5774 -5774
  11. data/app/assets/stylesheets/clipster/clip.css +21 -21
  12. data/app/assets/stylesheets/clipster/clips.css +4 -4
  13. data/app/controllers/clipster/application_controller.rb +7 -7
  14. data/app/controllers/clipster/clips_controller.rb +80 -67
  15. data/app/helpers/clipster/application_helper.rb +4 -4
  16. data/app/helpers/clipster/clip_helper.rb +4 -4
  17. data/app/helpers/clipster/clips_helper.rb +4 -4
  18. data/app/models/clipster/clip.rb +74 -23
  19. data/app/views/clipster/clips/about.html.erb +15 -0
  20. data/app/views/clipster/clips/create.html.erb +46 -36
  21. data/app/views/clipster/clips/expired.html.erb +1 -0
  22. data/app/views/clipster/clips/list.html.erb +43 -37
  23. data/app/views/clipster/clips/show.html.erb +7 -5
  24. data/app/views/kaminari/_first_page.html.erb +3 -0
  25. data/app/views/kaminari/_gap.html.erb +3 -0
  26. data/app/views/kaminari/_last_page.html.erb +3 -0
  27. data/app/views/kaminari/_next_page.html.erb +3 -0
  28. data/app/views/kaminari/_page.html.erb +3 -0
  29. data/app/views/kaminari/_paginator.html.erb +17 -0
  30. data/app/views/kaminari/_prev_page.html.erb +3 -0
  31. data/app/views/layouts/clipster/application.html.erb +49 -48
  32. data/config/routes.rb +14 -13
  33. data/config/schedule.rb +10 -0
  34. data/db/migrate/20121004010757_create_clipster_clips.rb +16 -16
  35. data/db/migrate/20121007154400_add_hash_index_to_clips.rb +13 -13
  36. data/db/migrate/20121007155125_populate_clip_defaults.rb +21 -21
  37. data/db/migrate/20121007162741_rename_hash_to_url_hash.rb +9 -9
  38. data/db/migrate/20121007223358_remove_default_from_language.rb +9 -9
  39. data/db/migrate/20121007223631_set_default_title_to_untitled.rb +9 -9
  40. data/db/migrate/20121105212724_add_lifespan_to_clips.rb +9 -0
  41. data/lib/clipster/engine.rb +15 -14
  42. data/lib/clipster/version.rb +3 -3
  43. data/lib/clipster.rb +4 -4
  44. data/lib/tasks/clipster_tasks.rake +4 -4
  45. metadata +46 -3
@@ -1,48 +1,49 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <title>Clipster</title>
5
- <%= stylesheet_link_tag "clipster/application", :media => "all" %>
6
-
7
- <%= javascript_include_tag "clipster/application" %>
8
- <%= csrf_meta_tags %>
9
- </head>
10
- <body>
11
- <div class="container">
12
- <div class="navbar navbar-inverse navbar-fixed-top">
13
- <div class="navbar-inner">
14
- <div class="container">
15
- <div class="nav-collapse collapse">
16
- <%= link_to "Clipster", root_path, :class => "brand" %>
17
- <ul class="nav">
18
- <li><%= link_to "New Clip", root_path %></li>
19
- <li><%= link_to "Recent Clips", list_clips_path %></li>
20
- </ul>
21
- <!-- <form class="navbar-search pull-right"> -->
22
- <%= form_tag(search_clips_path, :method => 'get', :class => 'navbar-search pull-right') do %>
23
- <input type="text" class="search-query" name="search_term"placeholder="Search">
24
- <% end %>
25
-
26
- </div>
27
- </div>
28
- </div>
29
- </div>
30
- </div>
31
- <%#
32
- Do we want a header, if so this is how we do it. not sure if needed with fixed navbar
33
- <header class="jumbotron">
34
- <div class="container">
35
- <h3>Clipster</h3>
36
- <p class="lead">Code snippets before they were cool</p>
37
- </div>
38
- </header>
39
- %>
40
- <div class="container">
41
- <div class="row">
42
- <div class="span12">
43
- <%= yield %>
44
- </div>
45
- </div>
46
- </div>
47
- </body>
48
- </html>
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>Clipster</title>
5
+ <%= stylesheet_link_tag "clipster/application", :media => "all" %>
6
+
7
+ <%= javascript_include_tag "clipster/application" %>
8
+ <%= csrf_meta_tags %>
9
+ </head>
10
+ <body>
11
+ <div class="container">
12
+ <div class="navbar navbar-inverse navbar-fixed-top">
13
+ <div class="navbar-inner">
14
+ <div class="container">
15
+ <div class="nav-collapse collapse">
16
+ <%= link_to "Clipster", root_path, :class => "brand" %>
17
+ <ul class="nav">
18
+ <li><%= link_to "New Clip", :action=>:create %></li>
19
+ <li><%= link_to "Recent Clips", :action=>:list %></li>
20
+ <li><%= link_to "About", :action=>:about %></li>
21
+ </ul>
22
+ <!-- <form class="navbar-search pull-right"> -->
23
+ <%= form_tag(search_clips_path, :method => 'get', :class => 'navbar-search pull-right') do %>
24
+ <%= text_field_tag(:search_term, "", :class=>"search-query", :placeholder=>"Search") %>
25
+ <% end %>
26
+
27
+ </div>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ <%#
33
+ Do we want a header, if so this is how we do it. not sure if needed with fixed navbar
34
+ <header class="jumbotron">
35
+ <div class="container">
36
+ <h3>Clipster</h3>
37
+ <p class="lead">Code snippets before they were cool</p>
38
+ </div>
39
+ </header>
40
+ %>
41
+ <div class="container">
42
+ <div class="row">
43
+ <div class="span12">
44
+ <%= yield %>
45
+ </div>
46
+ </div>
47
+ </div>
48
+ </body>
49
+ </html>
data/config/routes.rb CHANGED
@@ -1,13 +1,14 @@
1
- Clipster::Engine.routes.draw do
2
- #/clipster route
3
-
4
- resources :clips, :path => "/" do
5
- collection do
6
- get 'list', :action => :list
7
- get 'list(/:lang)(.:format)', :action => :list
8
- get 'search', :action => :search
9
- end
10
- end
11
-
12
- root :to => :clips
13
- end
1
+ Clipster::Engine.routes.draw do
2
+ #/clipster route
3
+
4
+ resources :clips, :path => "/" do
5
+ collection do
6
+ get 'list', :action => :list
7
+ get 'list(/:lang)(.:format)', :action => :list
8
+ get 'search', :action => :search
9
+ get 'about', :action => :about
10
+ end
11
+ end
12
+
13
+ root :to => :clips
14
+ end
@@ -0,0 +1,10 @@
1
+ # Use this file to easily define all of your cron jobs.
2
+ #
3
+ # It's helpful, but not entirely necessary to understand cron before proceeding.
4
+ # http://en.wikipedia.org/wiki/Cron
5
+
6
+ every :day, :at => '3:00 am' do
7
+ runner "Clip.delete_expired_clips"
8
+ end
9
+
10
+ # Learn more: http://github.com/javan/whenever
@@ -1,16 +1,16 @@
1
- class CreateClipsterClips < ActiveRecord::Migration
2
- def up
3
- create_table :clipster_clips do |t|
4
- t.string :hash, :null => false
5
- t.text :clip, :null => false
6
- t.string :language, :null => false
7
- t.string :title, :null => false
8
- t.boolean :private, :null => false
9
- t.timestamps
10
- end
11
- end
12
-
13
- def down
14
- drop_table :clipster_clips
15
- end
16
- end
1
+ class CreateClipsterClips < ActiveRecord::Migration
2
+ def up
3
+ create_table :clipster_clips do |t|
4
+ t.string :hash, :null => false
5
+ t.text :clip, :null => false
6
+ t.string :language, :null => false
7
+ t.string :title, :null => false
8
+ t.boolean :private, :null => false
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def down
14
+ drop_table :clipster_clips
15
+ end
16
+ end
@@ -1,13 +1,13 @@
1
- class AddHashIndexToClips < ActiveRecord::Migration
2
- def up
3
- change_table :clipster_clips do |t|
4
- t.index :hash, :unique => true
5
- end
6
- end
7
-
8
- def down
9
- change_table :clipster_clips do |t|
10
- t.remove_index :hash
11
- end
12
- end
13
- end
1
+ class AddHashIndexToClips < ActiveRecord::Migration
2
+ def up
3
+ change_table :clipster_clips do |t|
4
+ t.index :hash, :unique => true
5
+ end
6
+ end
7
+
8
+ def down
9
+ change_table :clipster_clips do |t|
10
+ t.remove_index :hash
11
+ end
12
+ end
13
+ end
@@ -1,21 +1,21 @@
1
- class PopulateClipDefaults < ActiveRecord::Migration
2
- def up
3
- change_table :clipster_clips do |t|
4
- t.change_default :hash, ''
5
- t.change_default :clip, ''
6
- t.change_default :title, ''
7
- t.change_default :language, ''
8
- t.change_default :private, false
9
- end
10
- end
11
-
12
- def down
13
- change_table :clipster_clips do |t|
14
- t.change_default :hash, nil
15
- t.change_default :clip, nil
16
- t.change_default :title, nil
17
- t.change_default :language, nil
18
- t.change_default :private, false
19
- end
20
- end
21
- end
1
+ class PopulateClipDefaults < ActiveRecord::Migration
2
+ def up
3
+ change_table :clipster_clips do |t|
4
+ t.change_default :hash, ''
5
+ t.change_default :clip, ''
6
+ t.change_default :title, ''
7
+ t.change_default :language, ''
8
+ t.change_default :private, false
9
+ end
10
+ end
11
+
12
+ def down
13
+ change_table :clipster_clips do |t|
14
+ t.change_default :hash, nil
15
+ t.change_default :clip, nil
16
+ t.change_default :title, nil
17
+ t.change_default :language, nil
18
+ t.change_default :private, false
19
+ end
20
+ end
21
+ end
@@ -1,9 +1,9 @@
1
- class RenameHashToUrlHash < ActiveRecord::Migration
2
- def up
3
- rename_column :clipster_clips, :hash, :url_hash
4
- end
5
-
6
- def down
7
- rename_column :clipster_clips, :url_hash, :hash
8
- end
9
- end
1
+ class RenameHashToUrlHash < ActiveRecord::Migration
2
+ def up
3
+ rename_column :clipster_clips, :hash, :url_hash
4
+ end
5
+
6
+ def down
7
+ rename_column :clipster_clips, :url_hash, :hash
8
+ end
9
+ end
@@ -1,9 +1,9 @@
1
- class RemoveDefaultFromLanguage < ActiveRecord::Migration
2
- def up
3
- change_column_default :clipster_clips, :language, nil
4
- end
5
-
6
- def down
7
- change_column_default :clipster_clips, :language, ''
8
- end
9
- end
1
+ class RemoveDefaultFromLanguage < ActiveRecord::Migration
2
+ def up
3
+ change_column_default :clipster_clips, :language, nil
4
+ end
5
+
6
+ def down
7
+ change_column_default :clipster_clips, :language, ''
8
+ end
9
+ end
@@ -1,9 +1,9 @@
1
- class SetDefaultTitleToUntitled < ActiveRecord::Migration
2
- def up
3
- change_column_default :clipster_clips, :title, 'Untitled'
4
- end
5
-
6
- def down
7
- change_column_default :clipster_clips, :title, ''
8
- end
9
- end
1
+ class SetDefaultTitleToUntitled < ActiveRecord::Migration
2
+ def up
3
+ change_column_default :clipster_clips, :title, 'Untitled'
4
+ end
5
+
6
+ def down
7
+ change_column_default :clipster_clips, :title, ''
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddLifespanToClips < ActiveRecord::Migration
2
+ def up
3
+ add_column :clipster_clips, :expires, :datetime
4
+ end
5
+
6
+ def down
7
+ remove_column :clipster_clips, :expires
8
+ end
9
+ end
@@ -1,14 +1,15 @@
1
- require 'coderay'
2
- require 'dynamic_form'
3
-
4
- module Clipster
5
- class Engine < ::Rails::Engine
6
- isolate_namespace Clipster
7
-
8
- # so we can use rspec generators
9
- config.generators do |g|
10
- g.test_framework :rspec
11
- g.integration_tool :rspec
12
- end
13
- end
14
- 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
+ end
@@ -1,3 +1,3 @@
1
- module Clipster
2
- VERSION = "0.2.2"
3
- end
1
+ module Clipster
2
+ VERSION = "0.3.0"
3
+ end
data/lib/clipster.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "clipster/engine"
2
-
3
- module Clipster
4
- end
1
+ require "clipster/engine"
2
+
3
+ module Clipster
4
+ 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.2.2
4
+ version: 0.3.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-10-15 00:00:00.000000000 Z
13
+ date: 2012-11-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -76,6 +76,38 @@ dependencies:
76
76
  - - ! '>='
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
+ - !ruby/object:Gem::Dependency
80
+ name: whenever
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ type: :runtime
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
91
+ requirements:
92
+ - - ! '>='
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
95
+ - !ruby/object:Gem::Dependency
96
+ name: kaminari
97
+ requirement: !ruby/object:Gem::Requirement
98
+ none: false
99
+ requirements:
100
+ - - ! '>='
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ type: :runtime
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
107
+ requirements:
108
+ - - ! '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
79
111
  - !ruby/object:Gem::Dependency
80
112
  name: sqlite3
81
113
  requirement: !ruby/object:Gem::Requirement
@@ -129,20 +161,31 @@ files:
129
161
  - app/controllers/clipster/application_controller.rb
130
162
  - app/controllers/clipster/clips_controller.rb
131
163
  - app/helpers/clipster/application_helper.rb
132
- - app/helpers/clipster/clip_helper.rb
133
164
  - app/helpers/clipster/clips_helper.rb
165
+ - app/helpers/clipster/clip_helper.rb
134
166
  - app/models/clipster/clip.rb
167
+ - app/views/clipster/clips/about.html.erb
135
168
  - app/views/clipster/clips/create.html.erb
169
+ - app/views/clipster/clips/expired.html.erb
136
170
  - app/views/clipster/clips/list.html.erb
137
171
  - app/views/clipster/clips/show.html.erb
172
+ - app/views/kaminari/_first_page.html.erb
173
+ - app/views/kaminari/_gap.html.erb
174
+ - app/views/kaminari/_last_page.html.erb
175
+ - app/views/kaminari/_next_page.html.erb
176
+ - app/views/kaminari/_page.html.erb
177
+ - app/views/kaminari/_paginator.html.erb
178
+ - app/views/kaminari/_prev_page.html.erb
138
179
  - app/views/layouts/clipster/application.html.erb
139
180
  - config/routes.rb
181
+ - config/schedule.rb
140
182
  - db/migrate/20121004010757_create_clipster_clips.rb
141
183
  - db/migrate/20121007154400_add_hash_index_to_clips.rb
142
184
  - db/migrate/20121007155125_populate_clip_defaults.rb
143
185
  - db/migrate/20121007162741_rename_hash_to_url_hash.rb
144
186
  - db/migrate/20121007223358_remove_default_from_language.rb
145
187
  - db/migrate/20121007223631_set_default_title_to_untitled.rb
188
+ - db/migrate/20121105212724_add_lifespan_to_clips.rb
146
189
  - lib/clipster/engine.rb
147
190
  - lib/clipster/version.rb
148
191
  - lib/clipster.rb