roger_sneakpeek 0.0.3 → 0.1.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: fabd70b50930cfdeb776fb1295dde4db3d462124
4
- data.tar.gz: 0262a704c6751f09a98622566c20b9985cb905a9
3
+ metadata.gz: 65c48484573713d48546843dd66e9979058b91fd
4
+ data.tar.gz: d406d62f8fb6980656babfd85aefff4bdaa16f27
5
5
  SHA512:
6
- metadata.gz: a7591fdbd1d2b8c4a682db88f83564aee0812e20b0818554f267c1c85968eaba47dac49e76aece5b2c80c5a6caf16212166e6f294d2676c552edaecf8654311e
7
- data.tar.gz: 08efcb0016a91b3587740e2491338ad8c3141f15b3bd654a47fbc13cf4e70dfa03e0562c50af90445652b0c8c7d2f79f9f87e2904904f2c1e6e856669bf1e9cd
6
+ metadata.gz: 1e99a9b99a72cbc5d948c72f314b83a39a7f096421e0e044974bf7f9f1cdc3778a2f0aac75dc1ad042e07b94426ca1cdb3dded3d3be0d184ac2918850efebca6
7
+ data.tar.gz: b0f917af012cf4d4624ad170ea4dfebfa9a3d14c42e4a473d848e53fa70c6f633703898ae21559e97b8c05d7f3c8d27c93d5b2302e4ad6fa40b0f2c5f5bbe2e9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0
4
+ * Add compatibility with Roger 1.7.0
5
+
3
6
  ## 0.0.3
4
7
  * Add CI specific git info class
5
8
 
@@ -11,43 +11,40 @@ require File.dirname(__FILE__) + "/ci"
11
11
  module RogerSneakpeek
12
12
  # Finalizer to zip and upload release
13
13
  class Finalizer < Roger::Release::Finalizers::Base
14
- attr_reader :release, :current_options
14
+ self.name = :sneakpeek
15
15
 
16
- def call(release, call_options = {})
17
- options = {
16
+ def default_options
17
+ {
18
18
  zip: "zip",
19
19
  project: nil,
20
20
  gitlab_project: nil,
21
21
  ci_only: true,
22
22
  sneakpeek_api_url: "http://api.peek.digitpaint.nl"
23
- }.update(@options)
24
-
25
- options.update(call_options) if call_options
23
+ }
24
+ end
26
25
 
27
- unless options[:project]
26
+ def perform
27
+ unless @options[:project]
28
28
  fail ArgumentError, "You must specify a project to RogerSneakpeek"
29
29
  end
30
30
 
31
- unless options[:gitlab_project]
31
+ unless @options[:gitlab_project]
32
32
  fail ArgumentError, "You must specify a gitlab_project to RogerSneakpeek"
33
33
  end
34
34
 
35
35
  # If we run in ci_only mode and are not in CI we stop.
36
- return if options[:ci_only] && !CI.ci?
37
-
38
- @release = release
39
- @current_options = options
36
+ return if @options[:ci_only] && !CI.ci?
40
37
 
41
38
  check_zip_command
42
39
 
43
- release.log(self, "Starting upload to Sneakpeek")
40
+ @release.log(self, "Starting upload to Sneakpeek")
44
41
  upload_release zip_release
45
42
  end
46
43
 
47
44
  protected
48
45
 
49
46
  def zip_command(*args)
50
- ([Shellwords.escape(current_options[:zip])] + args).join(" ")
47
+ ([Shellwords.escape(@options[:zip])] + args).join(" ")
51
48
  end
52
49
 
53
50
  def check_zip_command
@@ -57,13 +54,13 @@ module RogerSneakpeek
57
54
  end
58
55
 
59
56
  def git(*args)
60
- cmd = Shellwords.join([current_options[:git]] + args)
57
+ cmd = Shellwords.join([@options[:git]] + args)
61
58
  `#{cmd}`
62
59
  end
63
60
 
64
61
  def zip_release
65
62
  zip_path = Dir::Tmpname.create ["release", ".zip"] {}
66
- ::Dir.chdir(release.build_path) do
63
+ ::Dir.chdir(@release.build_path) do
67
64
  command = zip_command("-r", "-9", Shellwords.escape(zip_path), "./*")
68
65
  output = `#{command}`
69
66
  fail "Could not generate zipfile\n#{output}" if $CHILD_STATUS.to_i != 0
@@ -76,23 +73,23 @@ module RogerSneakpeek
76
73
  if CI.ci?
77
74
  git = CI.new()
78
75
  else
79
- git = Git.new(path: release.project.path)
76
+ git = Git.new(path: @release.project.path)
80
77
  end
81
78
 
82
79
  data = perform_upload(
83
80
  sneakpeek_url(git),
84
81
  zip_path,
85
82
  sha: git.sha,
86
- gitlab_project: current_options[:gitlab_project]
83
+ gitlab_project: @options[:gitlab_project]
87
84
  )
88
85
 
89
- release.log(self, "Sneakpeek url: #{data['url']}") if data
86
+ @release.log(self, "Sneakpeek url: #{data['url']}") if data
90
87
  ensure
91
88
  File.unlink zip_path
92
89
  end
93
90
 
94
91
  def sneakpeek_url(git)
95
- project = current_options[:project]
92
+ project = @options[:project]
96
93
  case
97
94
  when git.tag
98
95
  "/projects/#{project}/tags/#{URI.escape(git.tag)}"
@@ -104,7 +101,7 @@ module RogerSneakpeek
104
101
  end
105
102
 
106
103
  def perform_upload(url, zip_path, params)
107
- conn = Faraday.new(current_options[:sneakpeek_api_url]) do |f|
104
+ conn = Faraday.new(@options[:sneakpeek_api_url]) do |f|
108
105
  f.request :multipart
109
106
  f.request :url_encoded
110
107
  f.adapter :net_http
@@ -1,4 +1,4 @@
1
1
  # Roger main namespace
2
2
  module RogerSneakpeek
3
- VERSION = "0.0.3".freeze
3
+ VERSION = "0.1.0".freeze
4
4
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.files = `git ls-files`.split("\n")
21
21
  s.require_paths = ["lib"]
22
22
 
23
- s.add_dependency "roger", "~> 1.4", ">= 1.0.0"
23
+ s.add_dependency "roger", "~> 1.7", ">= 1.0.0"
24
24
  s.add_dependency "faraday", "~> 0.8", ">= 0.8.11"
25
25
 
26
26
  s.add_development_dependency "rubocop", [">= 0"]
metadata CHANGED
@@ -1,127 +1,126 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roger_sneakpeek
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Flurin Egger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-25 00:00:00.000000000 Z
11
+ date: 2016-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roger
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.4'
20
- - - '>='
19
+ version: '1.7'
20
+ - - ">="
21
21
  - !ruby/object:Gem::Version
22
22
  version: 1.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ~>
27
+ - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '1.4'
30
- - - '>='
29
+ version: '1.7'
30
+ - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 1.0.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: faraday
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - ~>
37
+ - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0.8'
40
- - - '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: 0.8.11
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ~>
47
+ - - "~>"
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0.8'
50
- - - '>='
50
+ - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 0.8.11
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: rubocop
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
- - - '>='
57
+ - - ">="
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  type: :development
61
61
  prerelease: false
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - '>='
64
+ - - ">="
65
65
  - !ruby/object:Gem::Version
66
66
  version: '0'
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: rake
69
69
  requirement: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - '>='
71
+ - - ">="
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  type: :development
75
75
  prerelease: false
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - '>='
78
+ - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: '0'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: test-unit
83
83
  requirement: !ruby/object:Gem::Requirement
84
84
  requirements:
85
- - - '>='
85
+ - - ">="
86
86
  - !ruby/object:Gem::Version
87
87
  version: '0'
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - '>='
92
+ - - ">="
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: thor
97
97
  requirement: !ruby/object:Gem::Requirement
98
98
  requirements:
99
- - - ~>
99
+ - - "~>"
100
100
  - !ruby/object:Gem::Version
101
101
  version: '0'
102
102
  type: :development
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ~>
106
+ - - "~>"
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  - !ruby/object:Gem::Dependency
110
110
  name: mocha
111
111
  requirement: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - ~>
113
+ - - "~>"
114
114
  - !ruby/object:Gem::Version
115
115
  version: 1.1.0
116
116
  type: :development
117
117
  prerelease: false
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - ~>
120
+ - - "~>"
121
121
  - !ruby/object:Gem::Version
122
122
  version: 1.1.0
123
- description: |2
124
- Will upload the current release to the Sneakpeek server.
123
+ description: " Will upload the current release to the Sneakpeek server.\n"
125
124
  email:
126
125
  - info@digitpaint.nl
127
126
  - flurin@digitpaint.nl
@@ -129,7 +128,7 @@ executables: []
129
128
  extensions: []
130
129
  extra_rdoc_files: []
131
130
  files:
132
- - .rubocop.yml
131
+ - ".rubocop.yml"
133
132
  - CHANGELOG.md
134
133
  - Gemfile
135
134
  - Gemfile.lock
@@ -152,17 +151,17 @@ require_paths:
152
151
  - lib
153
152
  required_ruby_version: !ruby/object:Gem::Requirement
154
153
  requirements:
155
- - - '>='
154
+ - - ">="
156
155
  - !ruby/object:Gem::Version
157
156
  version: '0'
158
157
  required_rubygems_version: !ruby/object:Gem::Requirement
159
158
  requirements:
160
- - - '>='
159
+ - - ">="
161
160
  - !ruby/object:Gem::Version
162
161
  version: '0'
163
162
  requirements: []
164
163
  rubyforge_project:
165
- rubygems_version: 2.2.2
164
+ rubygems_version: 2.5.1
166
165
  signing_key:
167
166
  specification_version: 4
168
167
  summary: Deployment of releases to Sneakpeek server as Roger finalizer