rubygems_herald 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e5774ac3dd607b541788a7fb7b200b41e01ed60
4
- data.tar.gz: 36d519b4f2a4aa03ab5210d069a248a29706049b
3
+ metadata.gz: 38c4c5173829211389c5f171891d36810e0bd0ff
4
+ data.tar.gz: 65c08ed454e2811834f689cc935aee0b83e10d33
5
5
  SHA512:
6
- metadata.gz: 8b88f14361b24592a06382e0bb3f5475fd6c8a5fba4a0ea293943cec32bbfd1a6c3cad37cc03022fc524233c50ab0205e952074b1eefe874168dcca0fa2e8434
7
- data.tar.gz: 5eb02da23118dccd110612d35ff5335d61e9d5bb68eaea2250df81df141435a6a731fb0ffda8bd0ab0a71b56a66c0e8e4dfb640a088c87124782c541e88fa692
6
+ metadata.gz: 2afd707ecae718669c0fc52097e011c06950b1d1de5790980677f8b4a2521339f8b4bbd23ced9a644ade8da19d3e55c01c29cfd0ff56bd49251d3c10193b3983
7
+ data.tar.gz: 6caabacdfe8725b28ce55e111d72c35e82664f215a898129fb3099755a026520cab1a3fb4e5662d5237ec094dffb1cfc929381ebc7d511e30a9bfc58e48768d4
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -32,7 +32,7 @@ class GemDisplaysController < ApplicationController
32
32
  end
33
33
 
34
34
  def load_gem_display
35
- @gem_display = GemDisplay.find_by_name(params[:id]) or not_found
35
+ @gem_display = GemDisplay.find_or_create_by(name: params[:id]) or not_found
36
36
  end
37
37
 
38
38
  end
@@ -0,0 +1,5 @@
1
+ module GemDisplaysHelper
2
+ def gem_displays_widget
3
+ render(:partial => 'gem_displays/widget')
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ %h3= :top_gem_displays.l
2
+ %ul.list-group
3
+ - for gem_display in GemDisplay.order(version_downloads: :desc)
4
+ %li.list-group-item= badge_to gem_display.name, 'v ' + gem_display.version, gem_display
@@ -1,5 +1,6 @@
1
1
  -add_title :gem_displays.l
2
2
 
3
- %ul
4
- - @gem_displays.each do |gem_display|
5
- %li= link_to gem_display.name, gem_display
3
+ - for gem_display in @gem_displays
4
+ %h2= gem_display.name
5
+ %p= gem_display.info
6
+ = badge_to gem_display.name, gem_display.version, gem_display, class: 'btn btn-large btn-success'
@@ -13,18 +13,18 @@
13
13
  = '(' + @gem_display.version_downloads.to_s + ' ' + :for_this_version.l + ')'
14
14
 
15
15
  %h3= :links.l
16
- = nav_list class: 'nav-pills' do
16
+ .btn-group
17
17
  - if @gem_display.project_uri.present?
18
- = nav_item :project.l, @gem_display.project_uri
18
+ .btn.btn-default= link_to :project.l, @gem_display.project_uri
19
19
  - if @gem_display.homepage_uri.present?
20
- = nav_item :homepage.l, @gem_display.homepage_uri
20
+ .btn.btn-default= link_to :homepage.l, @gem_display.homepage_uri
21
21
  - if @gem_display.wiki_uri.present?
22
- = nav_item :wiki.l, @gem_display.wiki_uri
22
+ .btn.btn-default= link_to :wiki.l, @gem_display.wiki_uri
23
23
  - if @gem_display.documentation_uri.present?
24
- = nav_item :documentation.l, @gem_display.documentation_uri
24
+ .btn.btn-default= link_to :documentation.l, @gem_display.documentation_uri
25
25
  - if @gem_display.mailing_list_uri.present?
26
- = nav_item :mailing_list.l, @gem_display.mailing_list_uri
26
+ .btn.btn-default= link_to :mailing_list.l, @gem_display.mailing_list_uri
27
27
  - if @gem_display.source_code_uri.present?
28
- = nav_item :source_code.l, @gem_display.source_code_uri
28
+ .btn.btn-default= link_to :source_code.l, @gem_display.source_code_uri
29
29
  - if @gem_display.bug_tracker_uri.present?
30
- = nav_item :bug_tracker.l, @gem_display.bug_tracker_uri
30
+ .btn.btn-default= link_to :bug_tracker.l, @gem_display.bug_tracker_uri
@@ -34,7 +34,8 @@ en:
34
34
  bug_tracker: "Bug Tracker"
35
35
  project: "Project"
36
36
  documentation: "Documentation"
37
- gem_displays: "Gem Displays"
37
+ gem_displays: "Gems"
38
+ top_gem_displays: "Top Gems"
38
39
  description: "Description"
39
40
  license: "License"
40
41
  readme: "Readme"
@@ -0,0 +1,17 @@
1
+ module RubygemsHerald
2
+ class ViewsGenerator < Rails::Generators::Base
3
+ source_root File.expand_path('../../../../../app/views/gem_displays', __FILE__)
4
+ require File.expand_path('../../utils', __FILE__)
5
+ include Generators::Utils
6
+ include Rails::Generators::Migration
7
+
8
+ # all public methods in here will be run in order
9
+
10
+ def add_views
11
+ output "I'm copying the default views into app/views/gem_displays for you.", :magenta
12
+ template "index.html.haml", "app/views/gem_displays/index.html.haml"
13
+ template "show.html.haml", "app/views/gem_displays/show.html.haml"
14
+ template "_widget.html.haml", "app/views/gem_displays/_widget.html.haml"
15
+ end
16
+ end
17
+ end
@@ -46,7 +46,7 @@ class String
46
46
  if is_json?
47
47
  JSON.parse self
48
48
  else
49
- raise :invalid_json_response.l
49
+ raise :invalid_json_response.l + ': ' + self
50
50
  end
51
51
  end
52
52
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "rubygems_herald"
8
- s.version = "0.0.3"
8
+ s.version = "0.0.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Karen Lundgren"]
12
- s.date = "2014-05-13"
12
+ s.date = "2014-05-15"
13
13
  s.description = "For organizations that want to market a gem in style, Rubygems Herald syncs your gems' data via the RubyGems.org API so that your software marketing website stays up to date with the latest information about your gems."
14
14
  s.email = "karen.e.lundgren@gmail.com"
15
15
  s.extra_rdoc_files = [
@@ -27,7 +27,9 @@ Gem::Specification.new do |s|
27
27
  "Rakefile",
28
28
  "VERSION",
29
29
  "app/controllers/gem_displays_controller.rb",
30
+ "app/helpers/gem_displays_helper.rb",
30
31
  "app/models/gem_display.rb",
32
+ "app/views/gem_displays/_widget.html.haml",
31
33
  "app/views/gem_displays/index.html.haml",
32
34
  "app/views/gem_displays/show.html.haml",
33
35
  "config/locales/en.yml",
@@ -36,6 +38,7 @@ Gem::Specification.new do |s|
36
38
  "lib/generators/rubygems_herald/install/templates/initializer.rb",
37
39
  "lib/generators/rubygems_herald/install/templates/migrate/create_gem_displays_table.rb",
38
40
  "lib/generators/rubygems_herald/utils.rb",
41
+ "lib/generators/rubygems_herald/views/views_generator.rb",
39
42
  "lib/rubygems_herald.rb",
40
43
  "lib/rubygems_herald/configuration.rb",
41
44
  "lib/rubygems_herald/engine.rb",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubygems_herald
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karen Lundgren
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-13 00:00:00.000000000 Z
11
+ date: 2014-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -226,7 +226,9 @@ files:
226
226
  - Rakefile
227
227
  - VERSION
228
228
  - app/controllers/gem_displays_controller.rb
229
+ - app/helpers/gem_displays_helper.rb
229
230
  - app/models/gem_display.rb
231
+ - app/views/gem_displays/_widget.html.haml
230
232
  - app/views/gem_displays/index.html.haml
231
233
  - app/views/gem_displays/show.html.haml
232
234
  - config/locales/en.yml
@@ -235,6 +237,7 @@ files:
235
237
  - lib/generators/rubygems_herald/install/templates/initializer.rb
236
238
  - lib/generators/rubygems_herald/install/templates/migrate/create_gem_displays_table.rb
237
239
  - lib/generators/rubygems_herald/utils.rb
240
+ - lib/generators/rubygems_herald/views/views_generator.rb
238
241
  - lib/rubygems_herald.rb
239
242
  - lib/rubygems_herald/configuration.rb
240
243
  - lib/rubygems_herald/engine.rb