cutting_edge 0.0.1 → 0.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 (51) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +7 -2
  3. data/Gemfile.lock +130 -0
  4. data/LICENSE +68 -81
  5. data/Procfile +1 -0
  6. data/README.md +272 -74
  7. data/Rakefile +0 -5
  8. data/bin/cutting_edge +60 -45
  9. data/config.rb +55 -0
  10. data/cutting_edge.gemspec +33 -4
  11. data/heroku.config.rb +20 -0
  12. data/lib/cutting_edge.rb +1 -1
  13. data/lib/cutting_edge/app.rb +95 -19
  14. data/lib/cutting_edge/langs.rb +7 -1
  15. data/lib/cutting_edge/langs/python.rb +5 -1
  16. data/lib/cutting_edge/langs/ruby.rb +5 -1
  17. data/lib/cutting_edge/langs/rust.rb +5 -1
  18. data/lib/cutting_edge/public/images/error.svg +24 -0
  19. data/lib/cutting_edge/public/images/languages/python.svg +1 -0
  20. data/lib/cutting_edge/public/images/languages/ruby.svg +1 -0
  21. data/lib/cutting_edge/public/images/languages/rust.svg +1 -0
  22. data/lib/cutting_edge/public/images/ok.svg +24 -0
  23. data/lib/cutting_edge/public/javascript/clipboard.min.js +7 -0
  24. data/lib/cutting_edge/public/javascript/cuttingedge.js +53 -0
  25. data/lib/cutting_edge/public/stylesheets/primer.css +22 -0
  26. data/lib/cutting_edge/repo.rb +124 -18
  27. data/lib/cutting_edge/templates/_footer.html.erb +3 -0
  28. data/lib/cutting_edge/templates/_header.html.erb +8 -0
  29. data/lib/cutting_edge/templates/_overview.html.erb +9 -0
  30. data/lib/cutting_edge/templates/badge.svg.erb +39 -0
  31. data/lib/cutting_edge/templates/index.html.erb +62 -0
  32. data/lib/cutting_edge/templates/info.html.erb +101 -0
  33. data/lib/cutting_edge/templates/mail.html.erb +163 -0
  34. data/lib/cutting_edge/workers/badge.rb +33 -11
  35. data/lib/cutting_edge/workers/dependency.rb +36 -16
  36. data/lib/cutting_edge/workers/helpers.rb +8 -0
  37. data/lib/cutting_edge/workers/mail.rb +38 -0
  38. data/projects.yml +25 -0
  39. data/spec/app_spec.rb +115 -0
  40. data/spec/badge_worker_spec.rb +77 -0
  41. data/spec/dependency_worker_spec.rb +132 -0
  42. data/spec/email_worker_spec.rb +43 -0
  43. data/spec/fixtures.rb +180 -0
  44. data/spec/fixtures/projects.yml +27 -0
  45. data/spec/langs/python_spec.rb +47 -5
  46. data/spec/langs/ruby_spec.rb +105 -0
  47. data/spec/langs/rust_spec.rb +31 -0
  48. data/spec/repo_spec.rb +52 -0
  49. data/spec/spec_helper.rb +9 -1
  50. metadata +43 -15
  51. data/lib/cutting_edge/badge.rb +0 -46
@@ -1,10 +1,14 @@
1
1
  require 'simplecov'
2
+ require 'fixtures'
3
+ require 'rack/test'
2
4
 
3
5
  if ENV['TRAVIS']
4
6
  require 'coveralls'
5
7
  Coveralls.wear!
6
8
  end
7
9
 
10
+ ENV['RACK_ENV'] = 'test'
11
+
8
12
  require File.expand_path('../../lib/cutting_edge/app.rb', __FILE__)
9
13
  CuttingEdge::App.set(:enable_logging, false)
10
14
  ::SemanticLogger.add_appender(io: STDOUT)
@@ -108,4 +112,8 @@ RSpec.configure do |config|
108
112
  # as the one that triggered the failure.
109
113
  Kernel.srand config.seed
110
114
  =end
111
- end
115
+
116
+ config.include Rack::Test::Methods
117
+ config.include ::CuttingEdgeHelpers
118
+ config.include ::WorkerHelpers
119
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cutting_edge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: '0.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dawa Ometto
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-19 00:00:00.000000000 Z
12
+ date: 2020-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gemnasium-parser
@@ -82,61 +82,61 @@ dependencies:
82
82
  - !ruby/object:Gem::Version
83
83
  version: '1.2'
84
84
  - !ruby/object:Gem::Dependency
85
- name: victor
85
+ name: rufus-scheduler
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: 0.2.8
90
+ version: '3.6'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: 0.2.8
97
+ version: '3.6'
98
98
  - !ruby/object:Gem::Dependency
99
- name: rufus-scheduler
99
+ name: sinatra-logger
100
100
  requirement: !ruby/object:Gem::Requirement
101
101
  requirements:
102
102
  - - "~>"
103
103
  - !ruby/object:Gem::Version
104
- version: '3.6'
104
+ version: '0.3'
105
105
  type: :runtime
106
106
  prerelease: false
107
107
  version_requirements: !ruby/object:Gem::Requirement
108
108
  requirements:
109
109
  - - "~>"
110
110
  - !ruby/object:Gem::Version
111
- version: '3.6'
111
+ version: '0.3'
112
112
  - !ruby/object:Gem::Dependency
113
- name: sinatra-logger
113
+ name: toml-rb
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: '0.3'
118
+ version: '2.0'
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: '0.3'
125
+ version: '2.0'
126
126
  - !ruby/object:Gem::Dependency
127
- name: toml-rb
127
+ name: mail
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: '2.0'
132
+ version: '2.7'
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - "~>"
138
138
  - !ruby/object:Gem::Version
139
- version: '2.0'
139
+ version: '2.7'
140
140
  description: Self-hosted dependency monitoring, including shiny badges.
141
141
  email: d.ometto@gmail.com
142
142
  executables:
@@ -145,25 +145,53 @@ extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
147
  - Gemfile
148
+ - Gemfile.lock
148
149
  - LICENSE
150
+ - Procfile
149
151
  - README.md
150
152
  - Rakefile
151
153
  - bin/cutting_edge
154
+ - config.rb
152
155
  - cutting_edge.gemspec
156
+ - heroku.config.rb
153
157
  - lib/cutting_edge.rb
154
158
  - lib/cutting_edge/app.rb
155
- - lib/cutting_edge/badge.rb
156
159
  - lib/cutting_edge/langs.rb
157
160
  - lib/cutting_edge/langs/python.rb
158
161
  - lib/cutting_edge/langs/ruby.rb
159
162
  - lib/cutting_edge/langs/rust.rb
163
+ - lib/cutting_edge/public/images/error.svg
164
+ - lib/cutting_edge/public/images/languages/python.svg
165
+ - lib/cutting_edge/public/images/languages/ruby.svg
166
+ - lib/cutting_edge/public/images/languages/rust.svg
167
+ - lib/cutting_edge/public/images/ok.svg
168
+ - lib/cutting_edge/public/javascript/clipboard.min.js
169
+ - lib/cutting_edge/public/javascript/cuttingedge.js
170
+ - lib/cutting_edge/public/stylesheets/primer.css
160
171
  - lib/cutting_edge/repo.rb
172
+ - lib/cutting_edge/templates/_footer.html.erb
173
+ - lib/cutting_edge/templates/_header.html.erb
174
+ - lib/cutting_edge/templates/_overview.html.erb
175
+ - lib/cutting_edge/templates/badge.svg.erb
176
+ - lib/cutting_edge/templates/index.html.erb
177
+ - lib/cutting_edge/templates/info.html.erb
178
+ - lib/cutting_edge/templates/mail.html.erb
161
179
  - lib/cutting_edge/versions.rb
162
180
  - lib/cutting_edge/workers/badge.rb
163
181
  - lib/cutting_edge/workers/dependency.rb
164
182
  - lib/cutting_edge/workers/helpers.rb
183
+ - lib/cutting_edge/workers/mail.rb
184
+ - projects.yml
185
+ - spec/app_spec.rb
186
+ - spec/badge_worker_spec.rb
187
+ - spec/dependency_worker_spec.rb
188
+ - spec/email_worker_spec.rb
189
+ - spec/fixtures.rb
190
+ - spec/fixtures/projects.yml
165
191
  - spec/langs/python_spec.rb
192
+ - spec/langs/ruby_spec.rb
166
193
  - spec/langs/rust_spec.rb
194
+ - spec/repo_spec.rb
167
195
  - spec/spec_helper.rb
168
196
  homepage: http://github.com/repotag/cutting_edge
169
197
  licenses:
@@ -1,46 +0,0 @@
1
- require 'victor'
2
-
3
- class Badge
4
- BADGE_OPTIONS = {
5
- up_to_date: {
6
- bg_color: '#32CD32',
7
- text: 'up-to-date',
8
- width: 180
9
- },
10
- out_of_date: {
11
- bg_color: '#ff0000',
12
- text: 'out-of-date',
13
- width: 190
14
- },
15
- unknown: {
16
- bg_color: '#666',
17
- text: 'unknown',
18
- width: 170
19
- }
20
- }
21
-
22
- def self.build_badge(status, num=nil)
23
- if ! [:up_to_date, :out_of_date, :unknown].include?(status)
24
- status = :unknown
25
- end
26
- number = Integer(num) rescue nil if num
27
-
28
- svg = Victor::SVG.new width: BADGE_OPTIONS[status][:width], height: 32, template: :html
29
-
30
- style = {
31
- stroke: '#d3d3d3',
32
- stroke_width: 4
33
- }
34
-
35
- svg.build do
36
- rect x: 0, y: 0, width: BADGE_OPTIONS[status][:width], height: 32, fill: BADGE_OPTIONS[status][:bg_color], style: style
37
-
38
- g font_size: 14, font_family: 'arial', fill: 'white' do
39
- text "#{number} Dependencies #{BADGE_OPTIONS[status][:text]}", x: 10, y: 20
40
- end
41
- end
42
- return svg.render
43
- end
44
-
45
- end
46
-