danger-the_coding_love 0.0.7 → 0.0.8

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
  SHA256:
3
- metadata.gz: b410f9e8a7fff62174696e41797ee1eb61580a3085e0316bedea8bced6f45f97
4
- data.tar.gz: 81bb3876751e59d78377f7633e16a0a32efe0bf5c74248ca43eb966d26fd6829
3
+ metadata.gz: 429ca16f49a85e8102f9f8ac630e31687c71df5bfc4812981af781eeb5596765
4
+ data.tar.gz: 7b16f7c98fc9de3ba05800533fd995899cbdc2126e500d06c5a3bc6a15539b6e
5
5
  SHA512:
6
- metadata.gz: 3851ff21832a8f7a6dc78d060a631604234f403761bb3f37761ce47e3e62458b47bcf1e00452549b30d683c2b400697d41471c063ab0b4c56910ae197ae7a443
7
- data.tar.gz: e8cfd5f69fb64d32c70552e5a8fc51c906ed3edb94c90857f580050f95de48f962d18ae09ad93053d2180f17eeae24edfada708bf59f3234fcce379d613290b4
6
+ metadata.gz: ac7b1384e31bb14ad33025ac0ddf6235a35b7e680a88fbe1dc4779cabdc02ed595fd0e0713e52fe19e8387b0cc5e51cbe14ae7be1549ca54db69146f5972f7df
7
+ data.tar.gz: 0364a57a7e7a3f8c99d38961dbb049c1c587a1f4e9c2637e5f207f33206714250e79cdaf43589746714e5078f0472eb86e5e927ac6bfb29f03f386199f8dc1d9
@@ -4,7 +4,8 @@ cache:
4
4
  - bundle
5
5
 
6
6
  rvm:
7
- - 2.3.1
7
+ - 2.7.1
8
+ - 2.6.6
8
9
 
9
10
  script:
10
11
  - bundle exec rake spec
@@ -1,16 +1,16 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-the_coding_love (0.0.7)
4
+ danger-the_coding_love (0.0.8)
5
5
  danger-plugin-api (~> 1.0)
6
- nokogiri (>= 1.8.5)
6
+ nokogiri (>= 1.10.8)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- addressable (2.6.0)
12
- public_suffix (>= 2.0.2, < 4.0)
13
- claide (1.0.2)
11
+ addressable (2.7.0)
12
+ public_suffix (>= 2.0.2, < 5.0)
13
+ claide (1.0.3)
14
14
  claide-plugins (0.9.2)
15
15
  cork
16
16
  nap
@@ -19,14 +19,14 @@ GEM
19
19
  colored2 (3.1.2)
20
20
  cork (0.3.0)
21
21
  colored2 (~> 3.1)
22
- danger (6.0.9)
22
+ danger (6.3.2)
23
23
  claide (~> 1.0)
24
24
  claide-plugins (>= 0.9.2)
25
25
  colored2 (~> 3.1)
26
26
  cork (~> 0.1)
27
27
  faraday (~> 0.9)
28
28
  faraday-http-cache (~> 2.0)
29
- git (~> 1.5)
29
+ git (~> 1.6)
30
30
  kramdown (~> 2.0)
31
31
  kramdown-parser-gfm (~> 1.0)
32
32
  no_proxy_fix
@@ -35,14 +35,15 @@ GEM
35
35
  danger-plugin-api (1.0.0)
36
36
  danger (> 2.0)
37
37
  diff-lcs (1.3)
38
- faraday (0.15.4)
38
+ faraday (0.17.3)
39
39
  multipart-post (>= 1.2, < 3)
40
- faraday-http-cache (2.0.0)
41
- faraday (~> 0.8)
42
- ffi (1.11.1)
40
+ faraday-http-cache (2.2.0)
41
+ faraday (>= 0.8)
42
+ ffi (1.12.2)
43
43
  formatador (0.2.5)
44
- git (1.5.0)
45
- guard (2.15.0)
44
+ git (1.6.0)
45
+ rchardet (~> 1.8)
46
+ guard (2.16.2)
46
47
  formatador (>= 0.2.4)
47
48
  listen (>= 2.7, < 4.0)
48
49
  lumberjack (>= 1.0.12, < 2.0)
@@ -62,65 +63,67 @@ GEM
62
63
  listen (3.0.7)
63
64
  rb-fsevent (>= 0.9.3)
64
65
  rb-inotify (>= 0.9.7)
65
- lumberjack (1.0.13)
66
- method_source (0.9.2)
66
+ lumberjack (1.2.4)
67
+ method_source (1.0.0)
67
68
  mini_portile2 (2.4.0)
68
69
  multipart-post (2.1.1)
69
70
  nap (1.1.0)
70
71
  nenv (0.3.0)
71
72
  no_proxy_fix (0.1.2)
72
- nokogiri (1.10.3)
73
+ nokogiri (1.10.9)
73
74
  mini_portile2 (~> 2.4.0)
74
75
  notiffany (0.1.3)
75
76
  nenv (~> 0.1)
76
77
  shellany (~> 0.0)
77
- octokit (4.14.0)
78
+ octokit (4.18.0)
79
+ faraday (>= 0.9)
78
80
  sawyer (~> 0.8.0, >= 0.5.3)
79
81
  open4 (1.3.4)
80
- pry (0.12.2)
81
- coderay (~> 1.1.0)
82
- method_source (~> 0.9.0)
83
- public_suffix (3.1.1)
84
- rake (10.5.0)
82
+ pry (0.13.1)
83
+ coderay (~> 1.1)
84
+ method_source (~> 1.0)
85
+ public_suffix (4.0.4)
86
+ rake (12.3.3)
85
87
  rb-fsevent (0.10.3)
86
- rb-inotify (0.10.0)
88
+ rb-inotify (0.10.1)
87
89
  ffi (~> 1.0)
88
- rspec (3.8.0)
89
- rspec-core (~> 3.8.0)
90
- rspec-expectations (~> 3.8.0)
91
- rspec-mocks (~> 3.8.0)
92
- rspec-core (3.8.2)
93
- rspec-support (~> 3.8.0)
94
- rspec-expectations (3.8.4)
90
+ rchardet (1.8.0)
91
+ rspec (3.9.0)
92
+ rspec-core (~> 3.9.0)
93
+ rspec-expectations (~> 3.9.0)
94
+ rspec-mocks (~> 3.9.0)
95
+ rspec-core (3.9.1)
96
+ rspec-support (~> 3.9.1)
97
+ rspec-expectations (3.9.1)
95
98
  diff-lcs (>= 1.2.0, < 2.0)
96
- rspec-support (~> 3.8.0)
97
- rspec-mocks (3.8.1)
99
+ rspec-support (~> 3.9.0)
100
+ rspec-mocks (3.9.1)
98
101
  diff-lcs (>= 1.2.0, < 2.0)
99
- rspec-support (~> 3.8.0)
100
- rspec-support (3.8.2)
102
+ rspec-support (~> 3.9.0)
103
+ rspec-support (3.9.2)
101
104
  sawyer (0.8.2)
102
105
  addressable (>= 2.3.5)
103
106
  faraday (> 0.8, < 2.0)
104
107
  shellany (0.0.1)
105
108
  terminal-table (1.8.0)
106
109
  unicode-display_width (~> 1.1, >= 1.1.1)
107
- thor (0.20.3)
108
- unicode-display_width (1.6.0)
109
- yard (0.9.20)
110
+ thor (1.0.1)
111
+ unicode-display_width (1.7.0)
112
+ yard (0.9.24)
110
113
 
111
114
  PLATFORMS
112
115
  ruby
113
116
 
114
117
  DEPENDENCIES
115
- bundler (~> 1.3)
118
+ bundler (~> 2.1)
116
119
  danger-the_coding_love!
117
120
  guard (~> 2.14)
118
121
  guard-rspec (~> 4.7)
119
122
  listen (= 3.0.7)
120
123
  pry
121
- rake (~> 10.0)
124
+ rake (~> 12.3)
122
125
  rspec (~> 3.4)
123
126
  yard (>= 0.9.11)
124
127
 
125
128
  BUNDLED WITH
126
- 1.17.2
129
+ 2.1.4
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_runtime_dependency 'danger-plugin-api', '~> 1.0'
22
- spec.add_runtime_dependency 'nokogiri', '>= 1.8.5'
22
+ spec.add_runtime_dependency 'nokogiri', '>= 1.10.8'
23
23
 
24
24
  # General ruby development
25
- spec.add_development_dependency 'bundler', '~> 1.3'
26
- spec.add_development_dependency 'rake', '~> 10.0'
25
+ spec.add_development_dependency 'bundler', '~> 2.1'
26
+ spec.add_development_dependency 'rake', '~> 12.3'
27
27
 
28
28
  # Testing support
29
29
  spec.add_development_dependency 'rspec', '~> 3.4'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module TheCodingLove
2
- VERSION = "0.0.7".freeze
4
+ VERSION = '0.0.8'.freeze
3
5
  end
@@ -17,10 +17,17 @@ module Danger
17
17
  # @return [text, image_url]
18
18
  #
19
19
  def random
20
- text, image_url = at_url(random_post_url)
21
-
22
- markdown("------\n#{text}\n--\n![alt text](#{image_url} \"thecodinglove.com\")")
20
+ rnd_url = random_post_url
21
+ text, image_url = at_url(rnd_url)
23
22
 
23
+ markdown(
24
+ "------\n"\
25
+ "#{text}\n"\
26
+ "--\n"\
27
+ "![Funny image](#{image_url})\n"\
28
+ "--\n"\
29
+ "*Source: [The Coding Love](#{rnd_url})*"
30
+ )
24
31
  [text, image_url]
25
32
  end
26
33
 
@@ -31,8 +38,10 @@ module Danger
31
38
  def random_post_url
32
39
  require 'open-uri'
33
40
  require 'nokogiri'
34
- @main_page_doc = Nokogiri::HTML(open('https://thecodinglove.com'))
35
- random_love_page_url = @main_page_doc.at_xpath("//ul[@class='navbar-nav mr-auto']/a/@href").to_s
41
+ @main_page_doc = Nokogiri::HTML(URI.open('https://thecodinglove.com'))
42
+ random_love_page_url = @main_page_doc.at_xpath(
43
+ "//ul[@class='navbar-nav mr-auto']/li/a/@href"
44
+ ).to_s
36
45
  random_love_page_url
37
46
  end
38
47
 
@@ -41,6 +50,8 @@ module Danger
41
50
  # @return [text, image_url]
42
51
  #
43
52
  def at_url(love_page_url)
53
+ raise 'Empty coding love page URL' if love_page_url.empty?
54
+
44
55
  @doc = Nokogiri::HTML(URI.parse(love_page_url).open)
45
56
  @doc = @doc.at_xpath("//div[@class='blog-post content-single']")
46
57
 
@@ -17,7 +17,7 @@ module Danger
17
17
 
18
18
  it 'prints a random url' do
19
19
  rnd_url = @the_coding_love.random_post_url
20
-
20
+
21
21
  # expect(rnd_url).to eq('') # for development, should not be empty
22
22
  expect(rnd_url).not_to be_empty
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-the_coding_love
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valerio Mazzeo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-01 00:00:00.000000000 Z
11
+ date: 2020-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: danger-plugin-api
@@ -30,42 +30,42 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 1.8.5
33
+ version: 1.10.8
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 1.8.5
40
+ version: 1.10.8
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.3'
47
+ version: '2.1'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.3'
54
+ version: '2.1'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rake
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '10.0'
61
+ version: '12.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '10.0'
68
+ version: '12.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -191,8 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
191
191
  - !ruby/object:Gem::Version
192
192
  version: '0'
193
193
  requirements: []
194
- rubyforge_project:
195
- rubygems_version: 2.7.6
194
+ rubygems_version: 3.1.2
196
195
  signing_key:
197
196
  specification_version: 4
198
197
  summary: Prints markdown containing a random post from thecodinglove.com.