gem-gratitude 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/gem-gratitude.rb +12 -3
  3. data/template.erb +11 -1
  4. metadata +17 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b98e25a4daba5a9ea49a02dbb39d2d3ebe295246
4
- data.tar.gz: 8684a6a0a0a8ea2e20beef0f66b83fb146035be4
3
+ metadata.gz: 545b2312a30f79eec0e8e15c80e41b32ece077f1
4
+ data.tar.gz: 4c2b29a67b173fec3ad1d9a1a41e94dde7b77767
5
5
  SHA512:
6
- metadata.gz: d5658d3008de72b7a2a83f03b2c3fad40bdd702232eeb480babdefe5afb31273c5aff5f7eb258fd5372b8ec31fbed8166455419053eb983be88e110124ed7225
7
- data.tar.gz: 21d87a4b552b9313511be327039783ac72663d398f07f991ba005a6734a4e9502e4cf18ddaec0a1d0f580312f3a782656f2d8d12e56535e8fc164fc59d3aef25
6
+ metadata.gz: 4727bcab2ac13f06e8a9123663ee1ffecf0ec82e23cb503bfb6ec8e2a8d7214e125bf400200b41f7f05df24221b96339e02aa8dc3729b30a7ee4175e14bd7636
7
+ data.tar.gz: 6dca429e950ef5a274f36123d3bc2c06e72fffb9c28d2eaee89efc7159820f7c55750c6a4122edb93ddd70f0800cca9524efd202ac4c607412c94ceac70dfbf9
data/lib/gem-gratitude.rb CHANGED
@@ -3,6 +3,7 @@ require 'httparty'
3
3
  require 'json'
4
4
  require 'erb'
5
5
  require 'redcarpet'
6
+ require 'os'
6
7
 
7
8
  class Issue
8
9
  def self.list
@@ -30,7 +31,7 @@ class Issue
30
31
  if parts[0] == "gem" && parts[0].start_with?("gem")
31
32
  gem_name = parts[1]
32
33
  replacements.each {|r| gem_name.gsub!(r, '')}
33
- next if parts[2] == 'github:'
34
+ next if parts[2] =~ /github/
34
35
  begin
35
36
  gem_spec = Gem::Specification.find_by_name(gem_name)
36
37
  @gem_list << {name: gem_name, homepage: gem_spec.homepage} if gem_spec.homepage
@@ -67,9 +68,16 @@ class Issue
67
68
  puts "#{g[:name]}: #{g[:homepage]} - #{json.count} open issues"
68
69
  json.each do |issue|
69
70
  @issue_count += 1
71
+
72
+ @labels = '';
73
+ issue['labels'].each do |label|
74
+ @labels << "<span class='label' style='background-color:#{label['color']}'>#{label['name']}</span>"
75
+ end
76
+
70
77
  @html_content <<
71
78
  "<h3>[#{g[:name]}] #{issue['title']}</h3>"\
72
79
  "<div><a class='github_link' href=\"#{issue['html_url']}\">View on GitHub: #{issue['title']}</a>"\
80
+ "<div>#{@labels}</div>"\
73
81
  "#{@markdown.render(issue['body'].to_s)}</div>"
74
82
  end
75
83
  end
@@ -80,7 +88,8 @@ class Issue
80
88
  erb = ERB.new(File.read(File.expand_path(File.dirname(__FILE__)) + '/../template.erb'))
81
89
  file.write erb.result(binding)
82
90
 
83
- # Open up the resulting HTML file
84
- `open #{tmp_html}`
91
+ # Open up the resulting HTML file all cross-platform-like
92
+ `xdg-open #{tmp_html} &` if OS.linux?
93
+ `open #{tmp_html}` if OS.mac?
85
94
  end
86
95
  end
data/template.erb CHANGED
@@ -48,7 +48,17 @@
48
48
  max-width: 100%;
49
49
  max-height: 100%;
50
50
  }
51
+
52
+ .label {
53
+ display:inline-block;
54
+ padding: 0.2em 0.3em;
55
+ margin-right: 0.5em;
56
+ border-radius: 5px;
57
+
58
+ color: #FFF;
59
+ }
51
60
  </style>
61
+ <meta charset="utf-8"/>
52
62
  </head>
53
63
 
54
64
  <body>
@@ -59,4 +69,4 @@
59
69
  <%= @html_content %>
60
70
  </div>
61
71
  </body>
62
- </html>
72
+ </html>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-gratitude
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Bartlett
@@ -38,8 +38,22 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- description: Give back to gems you depend on! Show all open GitHub issues for gems
42
- you require in your projects
41
+ - !ruby/object:Gem::Dependency
42
+ name: os
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.9'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.9'
55
+ description: Give back to gems you depend on! gem-gratitude will scan your dependencies
56
+ and find any open issues for you help out on
43
57
  email: danbartlett@gmail.com
44
58
  executables:
45
59
  - gem-gratitude