danger-device_grid 0.1.2 → 0.2.0

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: 24146e81aec797842e6bbd8cf8f0ca32d686cda5
4
- data.tar.gz: a0a6f87d66e38932239848d50cc25ff7b80c25a1
3
+ metadata.gz: 13371b122abdf398631b824c58ab1d05d3747e24
4
+ data.tar.gz: 1bb4329ead14859c5afe27bab85695e8334da349
5
5
  SHA512:
6
- metadata.gz: 3213aedf934c07c464a193fe6e3b638ce3e62d3702b626f45c2605d4af007d4daf5c60b814400174fc8ec7bd48f1f56616a92cfa2cd389cd231be7873bf7f942
7
- data.tar.gz: eabb6d9f4a4250b2b7f5712aae2997f9e36c581752a645b521c87c29edf4c57c565038f950a5cf54dea29f5e68bff4b6b0c66d0d915e8adb7980b3a0329d9783
6
+ metadata.gz: 0475d605c9337bae9f4334977ff0866e2988821929dfd3c9774132da80f8038b586f6fd55fd811edbf0187bf8cd1028b53751766a2ced51c37e9e907c1f6743b
7
+ data.tar.gz: 41079867a8c8a30287f25b479987928acd51e671b8677c70b8c44f7ea7ebd31ff9aeb2dc6a2befc0a7ab1a6771084be1b4a853c919409abc4ac5c3e04be643ea
@@ -0,0 +1,5 @@
1
+ # Danger Device Grid plugin
2
+
3
+ This is a plugin for the popular [Danger code review tool](https://danger.systems). It makes it possible to include a device grid showing all your screenshots directly inside your project's PRs.
4
+
5
+ You can find the full documentation inside of the [main fastlane repo here](https://github.com/fastlane/fastlane/tree/master/fastlane/lib/fastlane/actions/device_grid).
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ['Felix Krause', 'Boris Bügling']
10
10
  spec.email = ['danger@krausefx.com', 'boris@icculus.org']
11
11
  spec.summary = %q{Danger plugin for the fastlane device grid.}
12
- spec.homepage = 'https://github.com/fastlane/fastlane/tree/master/danger-device_grid'
12
+ spec.homepage = 'https://github.com/fastlane/danger-device_grid'
13
13
  spec.license = 'MIT'
14
14
 
15
15
  spec.files = `git ls-files`.split($/)
@@ -17,10 +17,11 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ['lib']
19
19
 
20
- spec.add_dependency 'fastlane', '>= 1.94.0', '< 2.0.0'
20
+ spec.add_dependency "fastlane", ">= 2.0.0", "< 3.0.0"
21
21
 
22
22
  spec.add_development_dependency 'bundler', '~> 1.3'
23
- spec.add_development_dependency 'rake'
23
+ spec.add_development_dependency 'rake', '< 12'
24
24
  spec.add_development_dependency 'rspec', '~> 3.1.0'
25
25
  spec.add_development_dependency 'rspec_junit_formatter', '~> 0.2.3'
26
+ spec.add_development_dependency 'rubocop', '~> 0.44.0'
26
27
  end
@@ -1,3 +1,3 @@
1
1
  module DeviceGrid
2
- VERSION = "0.1.2".freeze
2
+ VERSION = "0.2.0".freeze
3
3
  end
@@ -15,7 +15,7 @@ module Danger
15
15
  fastlane_colors_were_disabled = ENV.key?(fastlane_colors_env)
16
16
  ENV[fastlane_colors_env] = "true"
17
17
 
18
- devices ||= %w(iphone4s iphone5s iphone6s iphone6splus ipadair)
18
+ devices ||= %w(iphone4s iphone5s iphone6s iphone7 iphone6splus iphone7plus ipadair)
19
19
  languages ||= ["en"]
20
20
 
21
21
  prefix_command ||= ""
@@ -26,15 +26,16 @@ module Danger
26
26
  deep_link_matches = github.pr_body.match(/:link:\s(.*)/) # :link: emoji
27
27
  deep_link = deep_link_matches[1] if deep_link_matches
28
28
 
29
- markdown("<table>")
29
+ html = ""
30
+ html << "<table>"
30
31
  languages.each do |current_language|
31
- markdown("<tr>")
32
- markdown("<td>")
33
- markdown("<b>#{current_language[0..1]}</b>")
34
- markdown("</td>")
32
+ html << "<tr>"
33
+ html << "<td>"
34
+ html << "<b>#{current_language[0..1]}</b>"
35
+ html << "</td>"
35
36
 
36
37
  devices.each do |current_device|
37
- markdown("<td>")
38
+ html << "<td>"
38
39
 
39
40
  params = {
40
41
  public_key: public_key,
@@ -46,19 +47,20 @@ module Danger
46
47
  url = Fastlane::Helper.backticks("#{prefix_command}fastlane run appetize_viewing_url_generator #{params_str}")
47
48
  url = url.match(%r{Result:.*(https\:\/\/.*)})[1].strip
48
49
 
49
- markdown("<a href='#{url}'>")
50
- markdown("<p align='center'>")
51
- markdown("<img height='130' src='#{url_for_device(current_device)}' />")
52
- markdown("<br />")
53
- markdown(beautiful_device_name(current_device))
54
- markdown("</p>")
55
- markdown("</a>")
50
+ html << "<a href='#{url}'>"
51
+ html << "<p align='center'>"
52
+ html << "<img height='130' src='#{url_for_device(current_device)}' />"
53
+ html << "<br />"
54
+ html << beautiful_device_name(current_device)
55
+ html << "</p>"
56
+ html << "</a>"
56
57
 
57
- markdown("</td>")
58
+ html << "</td>"
58
59
  end
59
- markdown("</tr>")
60
+ html << "</tr>"
60
61
  end
61
- markdown("</table>")
62
+ html << "</table>"
63
+ markdown(html)
62
64
  ensure
63
65
  ENV.delete(fastlane_colors_env) unless fastlane_colors_were_disabled
64
66
  end
@@ -73,7 +75,9 @@ module Danger
73
75
  iphone6splus: "iPhone 6s Plus",
74
76
  ipadair: "iPad Air",
75
77
  iphone6: "iPhone 6",
78
+ iphone7: "iPhone 7",
76
79
  iphone6plus: "iPhone 6 Plus",
80
+ iphone7plus: "iPhone 7 Plus",
77
81
  ipadair2: "iPad Air 2",
78
82
  nexus5: "Nexus 5",
79
83
  nexus7: "Nexus 7",
@@ -88,8 +92,10 @@ module Danger
88
92
  iphone4s: host + "iphone4s.png",
89
93
  iphone5s: host + "iphone5s.png",
90
94
  iphone6: host + "iphone6s.png",
95
+ iphone7: host + "iphone6s.png",
91
96
  iphone6s: host + "iphone6s.png",
92
97
  iphone6plus: host + "iphone6splus.png",
98
+ iphone7plus: host + "iphone6splus.png",
93
99
  iphone6splus: host + "iphone6splus.png",
94
100
  ipadair: host + "ipadair.png",
95
101
  ipadair2: host + "ipadair.png"
@@ -18,7 +18,7 @@ module Danger
18
18
 
19
19
  def markdown(str)
20
20
  @current_markdown ||= ""
21
- @current_markdown += "#{str}\n"
21
+ @current_markdown += str.to_s
22
22
  end
23
23
  end
24
24
  end
@@ -31,12 +31,17 @@ module Danger
31
31
 
32
32
  it "works" do
33
33
  public_key = "1461233806"
34
+ correct = File.read("spec/fixtures/device_grid_results.html")
35
+ .gsub("[[version]]", Fastlane::VERSION)
36
+ .delete("\n")
37
+
34
38
  dg = Danger::DangerDeviceGrid.new(Danger::Dangerfile::DSL::Plugin.new)
39
+ allow(dg).to receive(:markdown).once.with(correct).and_call_original
40
+
35
41
  dg.run(languages: ['en', 'de'],
36
42
  devices: ['iphone4s'],
37
43
  public_key: public_key)
38
44
 
39
- correct = File.read("spec/fixtures/device_grid_results.html").gsub("[[version]]", Fastlane::VERSION)
40
45
  expect(dg.current_markdown).to eq(correct)
41
46
  end
42
47
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: danger-device_grid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-08-02 00:00:00.000000000 Z
12
+ date: 2016-12-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fastlane
@@ -17,20 +17,20 @@ dependencies:
17
17
  requirements:
18
18
  - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 1.94.0
20
+ version: 2.0.0
21
21
  - - "<"
22
22
  - !ruby/object:Gem::Version
23
- version: 2.0.0
23
+ version: 3.0.0
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
28
  - - ">="
29
29
  - !ruby/object:Gem::Version
30
- version: 1.94.0
30
+ version: 2.0.0
31
31
  - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.0.0
33
+ version: 3.0.0
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: bundler
36
36
  requirement: !ruby/object:Gem::Requirement
@@ -49,16 +49,16 @@ dependencies:
49
49
  name: rake
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "<"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '12'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ">="
59
+ - - "<"
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '12'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: rspec
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -87,6 +87,20 @@ dependencies:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.2.3
90
+ - !ruby/object:Gem::Dependency
91
+ name: rubocop
92
+ requirement: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.44.0
97
+ type: :development
98
+ prerelease: false
99
+ version_requirements: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: 0.44.0
90
104
  description:
91
105
  email:
92
106
  - danger@krausefx.com
@@ -96,6 +110,7 @@ extensions: []
96
110
  extra_rdoc_files: []
97
111
  files:
98
112
  - Gemfile
113
+ - README.md
99
114
  - Rakefile
100
115
  - danger-device_grid.gemspec
101
116
  - lib/danger_device_grid.rb
@@ -105,7 +120,7 @@ files:
105
120
  - spec/device_grid_spec.rb
106
121
  - spec/fixtures/device_grid_results.html
107
122
  - spec/spec_helper.rb
108
- homepage: https://github.com/fastlane/fastlane/tree/master/danger-device_grid
123
+ homepage: https://github.com/fastlane/danger-device_grid
109
124
  licenses:
110
125
  - MIT
111
126
  metadata: {}
@@ -125,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
140
  version: '0'
126
141
  requirements: []
127
142
  rubyforge_project:
128
- rubygems_version: 2.6.6
143
+ rubygems_version: 2.6.8
129
144
  signing_key:
130
145
  specification_version: 4
131
146
  summary: Danger plugin for the fastlane device grid.