baps 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rake +17 -0
- data/dev.yml +15 -0
- data/lib/baps/deb.rb +4 -3
- data/lib/baps/packagecloud_api.rb +4 -2
- data/lib/baps/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c91f8b32f28201416c245f4abc5c8b43a162884
|
4
|
+
data.tar.gz: 4c4f753702c380296db4a0c87f3bc7b49d8123be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33cbf1b4bb552e2ef1e3639d3ef57a3759988e2cd4cb4f8b26ce76e29f7881756ed92e0fd9c0268aa10d7575f0edff4dd22102d47b0d7c26671d52e7ce0248e6
|
7
|
+
data.tar.gz: 36382456f0aedbb53356330f3a41467164cc09395478084b941b9f08cbb4835a9a827826c743ae354869dda6df13c4c5293367477ff630a70033e328fdf384e2
|
data/bin/rake
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
#
|
4
|
+
# This file was generated by Bundler.
|
5
|
+
#
|
6
|
+
# The application 'rake' is installed as part of a gem, and
|
7
|
+
# this file is here to facilitate running it.
|
8
|
+
#
|
9
|
+
|
10
|
+
require "pathname"
|
11
|
+
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
12
|
+
Pathname.new(__FILE__).realpath)
|
13
|
+
|
14
|
+
require "rubygems"
|
15
|
+
require "bundler/setup"
|
16
|
+
|
17
|
+
load Gem.bin_path("rake", "rake")
|
data/dev.yml
ADDED
data/lib/baps/deb.rb
CHANGED
@@ -4,10 +4,10 @@ module Baps
|
|
4
4
|
raise StandardError.new('Nothing defined') unless block_given?
|
5
5
|
instance_eval(&block)
|
6
6
|
end
|
7
|
-
|
7
|
+
|
8
8
|
def already_exist?
|
9
9
|
return false unless Executor.publish?
|
10
|
-
Baps.packagecloud.package_exist?(name: name, version: version)
|
10
|
+
Baps.packagecloud.package_exist?(name: name, version: version, release: release)
|
11
11
|
end
|
12
12
|
|
13
13
|
def create
|
@@ -27,6 +27,7 @@ module Baps
|
|
27
27
|
command = "fpm -s dir -C #{build.deb_dir} -v #{version} -t deb "\
|
28
28
|
"--description '#{description}' --vendor '' "\
|
29
29
|
"-n #{name} --deb-priority #{priority or 'optional'} --deb-compression bzip2"
|
30
|
+
command << " --iteration #{release}" if release
|
30
31
|
command << " #{dependencies.map { |d| "-d '#{d}'" }.join(' ')}" if dependencies
|
31
32
|
command << " --replaces '#{replaces}'" if replaces
|
32
33
|
command << " #{targets.join(' ')}" if targets
|
@@ -40,7 +41,7 @@ module Baps
|
|
40
41
|
@build = Build.new(name, version, &block)
|
41
42
|
end
|
42
43
|
|
43
|
-
%i(name version dependencies description targets priority replaces).each do |method|
|
44
|
+
%i(name version dependencies description targets priority release replaces).each do |method|
|
44
45
|
define_method(method) do |value = nil|
|
45
46
|
return instance_variable_get("@#{method}") if value.nil?
|
46
47
|
instance_variable_set("@#{method}", value)
|
@@ -18,8 +18,10 @@ module Baps
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def package_exist?(name:, version:, arch: 'amd64', type: 'deb')
|
22
|
-
|
21
|
+
def package_exist?(name:, version:, release:, arch: 'amd64', type: 'deb', os: 'ubuntu', dist: 'trusty')
|
22
|
+
package = "#{type}/#{os}/#{dist}/#{name}/#{arch}/#{version}"
|
23
|
+
package << "-#{release}" if release
|
24
|
+
url = "/api/v1/repos/shopify/public/package/#{package}/stats/downloads/count.json"
|
23
25
|
json = @client.send(:get, url)
|
24
26
|
result = @client.send(:parsed_json_result, json)
|
25
27
|
result.succeeded
|
data/lib/baps/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elvin Efendi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-01-
|
11
|
+
date: 2017-01-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fpm
|
@@ -107,12 +107,13 @@ files:
|
|
107
107
|
- ".ruby-version"
|
108
108
|
- Dockerfile
|
109
109
|
- Gemfile
|
110
|
-
- Gemfile.lock
|
111
110
|
- README.md
|
112
111
|
- Rakefile
|
113
112
|
- baps.gemspec
|
114
113
|
- bin/console
|
114
|
+
- bin/rake
|
115
115
|
- circle.yml
|
116
|
+
- dev.yml
|
116
117
|
- exe/baps
|
117
118
|
- lib/baps.rb
|
118
119
|
- lib/baps/build.rb
|