clipster 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +20 -20
- data/README.md +72 -0
- data/Rakefile +34 -34
- data/app/assets/images/clipster/rss_logo_small.png +0 -0
- data/app/assets/javascripts/clipster/application.js +15 -15
- data/app/assets/javascripts/clipster/bootstrap.js +2026 -2026
- data/app/assets/javascripts/clipster/bootstrap.min.js +5 -5
- data/app/assets/javascripts/clipster/clip.js +2 -2
- data/app/assets/javascripts/clipster/clips.js +7 -2
- data/app/assets/javascripts/clipster/users.js +2 -0
- data/app/assets/stylesheets/clipster/application.css +27 -27
- data/app/assets/stylesheets/clipster/bootstrap.css +5774 -5774
- data/app/assets/stylesheets/clipster/clip.css +31 -21
- data/app/assets/stylesheets/clipster/clips.css +4 -4
- data/app/assets/stylesheets/clipster/users.css +4 -0
- data/app/controllers/clipster/application_controller.rb +14 -7
- data/app/controllers/clipster/clips_controller.rb +86 -80
- data/app/controllers/clipster/users_controller.rb +17 -0
- data/app/helpers/clipster/application_helper.rb +19 -4
- data/app/helpers/clipster/clip_helper.rb +4 -4
- data/app/helpers/clipster/clips_helper.rb +4 -4
- data/app/helpers/clipster/users_helper.rb +4 -0
- data/app/models/clipster/clip.rb +99 -74
- data/app/views/clipster/clips/about.html.erb +14 -14
- data/app/views/clipster/clips/create.html.erb +56 -46
- data/app/views/clipster/clips/list.atom.builder +22 -0
- data/app/views/clipster/clips/list.html.erb +60 -43
- data/app/views/clipster/clips/show.html.erb +8 -8
- data/app/views/clipster/users/index.html.erb +2 -0
- data/app/views/clipster/users/show.html.erb +46 -0
- data/app/views/kaminari/_first_page.html.erb +3 -3
- data/app/views/kaminari/_gap.html.erb +3 -3
- data/app/views/kaminari/_last_page.html.erb +3 -3
- data/app/views/kaminari/_next_page.html.erb +3 -3
- data/app/views/kaminari/_page.html.erb +3 -3
- data/app/views/kaminari/_paginator.html.erb +17 -17
- data/app/views/kaminari/_prev_page.html.erb +3 -3
- data/app/views/layouts/clipster/application.html.erb +62 -49
- data/config/routes.rb +16 -14
- data/config/schedule.rb +10 -10
- data/db/migrate/20121004010757_create_clipster_clips.rb +16 -16
- data/db/migrate/20121007154400_add_hash_index_to_clips.rb +13 -13
- data/db/migrate/20121007155125_populate_clip_defaults.rb +21 -21
- data/db/migrate/20121007162741_rename_hash_to_url_hash.rb +9 -9
- data/db/migrate/20121007223358_remove_default_from_language.rb +9 -9
- data/db/migrate/20121007223631_set_default_title_to_untitled.rb +9 -9
- data/db/migrate/20121105212724_add_lifespan_to_clips.rb +9 -9
- data/db/migrate/20121114175749_add_user_id_to_clips.rb +9 -0
- data/lib/clipster/configuration.rb +23 -0
- data/lib/clipster/engine.rb +23 -15
- data/lib/clipster/version.rb +3 -3
- data/lib/clipster.rb +5 -4
- data/lib/generators/clipster/install_generator.rb +19 -0
- data/lib/generators/templates/clipster.rb +12 -0
- data/lib/tasks/clipster_tasks.rake +4 -4
- metadata +16 -4
- data/README.rdoc +0 -54
data/MIT-LICENSE
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright 2012 Kyle Bock, Daniel White
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright 2012 Kyle Bock, Daniel White
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,72 @@
|
|
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. Try it out at http://developerdan.com/clipster
|
8
|
+
* Features
|
9
|
+
* Syntax highlighting
|
10
|
+
* Expiring clips
|
11
|
+
* Public and private clips
|
12
|
+
* Atom Feed for public clips
|
13
|
+
* Optional user integration
|
14
|
+
|
15
|
+
## Production
|
16
|
+
|
17
|
+
Add clipster to your Gemfile and then bundle install
|
18
|
+
|
19
|
+
gem 'clipster'
|
20
|
+
bundle install
|
21
|
+
|
22
|
+
or if you aren't using Bundler, run
|
23
|
+
|
24
|
+
gem install 'clipster'
|
25
|
+
|
26
|
+
Mount the Clipster Engine in your applcations routes.rb like follows.
|
27
|
+
|
28
|
+
mount Clipster::Engine, :at => '/clipster'
|
29
|
+
|
30
|
+
cd to your apps root and run
|
31
|
+
|
32
|
+
rails g clipster:install
|
33
|
+
rake db:migrate
|
34
|
+
|
35
|
+
Restart your application and you should be able to access the engine at http://domain.tld/clipster
|
36
|
+
|
37
|
+
## Development
|
38
|
+
|
39
|
+
cd into your test application directory's lib folder and run the following
|
40
|
+
|
41
|
+
git clone https://github.com/kwbock/clipster.git
|
42
|
+
|
43
|
+
Add the following to your app's Gemfile
|
44
|
+
|
45
|
+
gem 'clipster', :path => './lib/clipster'
|
46
|
+
|
47
|
+
Add the following to your app's routes.rb
|
48
|
+
|
49
|
+
mount Clipster::Engine, :at => '/clipster'
|
50
|
+
|
51
|
+
cd to your apps root and run
|
52
|
+
|
53
|
+
rake clipster:install:migrations
|
54
|
+
rake db:migrate
|
55
|
+
|
56
|
+
Launch your server and navigate to https://localhost:3000/clipster to confirm the engine was mounted correctly
|
57
|
+
|
58
|
+
## Enabling User Intgration
|
59
|
+
|
60
|
+
|
61
|
+
* Edit the `clipster.rb` initializer to enable user integration with Clipster.
|
62
|
+
* set `config.associates_clip_with_user = true`
|
63
|
+
* set `config.user_class = "YourUserClass"` if your users class is something other than `User`. NOTE: user_class must be a string.
|
64
|
+
* set `config.user_display_attribute = "display field"` if your display field is something other than `email`.
|
65
|
+
* NOTE: Clipster's user integration default settings are set up for [Devise](https://github.com/plataformatec/devise). Following the standard Devise install and enabling `config.associates_clip_with_user = true` is the minimum necessary to enable user integration.
|
66
|
+
|
67
|
+
Restart your application and you should be able to access the engine at http://domain.tld/clipster
|
68
|
+
|
69
|
+
### Todos
|
70
|
+
|
71
|
+
* Refactor Clips controller to be totally RESTful.
|
72
|
+
* Get tests written for all features, preferably with mocks if thats possible.
|
data/Rakefile
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
#!/usr/bin/env rake
|
2
|
-
begin
|
3
|
-
require 'bundler/setup'
|
4
|
-
rescue LoadError
|
5
|
-
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
-
end
|
7
|
-
begin
|
8
|
-
require 'rdoc/task'
|
9
|
-
rescue LoadError
|
10
|
-
require 'rdoc/rdoc'
|
11
|
-
require 'rake/rdoctask'
|
12
|
-
RDoc::Task = Rake::RDocTask
|
13
|
-
end
|
14
|
-
|
15
|
-
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
-
rdoc.rdoc_dir = 'rdoc'
|
17
|
-
rdoc.title = 'Clipster'
|
18
|
-
rdoc.options << '--line-numbers'
|
19
|
-
rdoc.rdoc_files.include('README.rdoc')
|
20
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
-
end
|
22
|
-
|
23
|
-
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
24
|
-
load 'rails/tasks/engine.rake'
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
Bundler::GemHelper.install_tasks
|
29
|
-
|
30
|
-
require 'rspec/core/rake_task'
|
31
|
-
RSpec::Core::RakeTask.new(:spec)
|
32
|
-
|
33
|
-
|
34
|
-
task :default => :spec
|
1
|
+
#!/usr/bin/env rake
|
2
|
+
begin
|
3
|
+
require 'bundler/setup'
|
4
|
+
rescue LoadError
|
5
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'rdoc/task'
|
9
|
+
rescue LoadError
|
10
|
+
require 'rdoc/rdoc'
|
11
|
+
require 'rake/rdoctask'
|
12
|
+
RDoc::Task = Rake::RDocTask
|
13
|
+
end
|
14
|
+
|
15
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
16
|
+
rdoc.rdoc_dir = 'rdoc'
|
17
|
+
rdoc.title = 'Clipster'
|
18
|
+
rdoc.options << '--line-numbers'
|
19
|
+
rdoc.rdoc_files.include('README.rdoc')
|
20
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
end
|
22
|
+
|
23
|
+
APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
|
24
|
+
load 'rails/tasks/engine.rake'
|
25
|
+
|
26
|
+
|
27
|
+
|
28
|
+
Bundler::GemHelper.install_tasks
|
29
|
+
|
30
|
+
require 'rspec/core/rake_task'
|
31
|
+
RSpec::Core::RakeTask.new(:spec)
|
32
|
+
|
33
|
+
|
34
|
+
task :default => :spec
|
Binary file
|
@@ -1,15 +1,15 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// the compiled file.
|
9
|
-
//
|
10
|
-
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
-
// GO AFTER THE REQUIRES BELOW.
|
12
|
-
//
|
13
|
-
//= require jquery
|
14
|
-
//= require jquery_ujs
|
15
|
-
//= require_tree .
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require_tree .
|