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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b44d9460157e18239dd322498a7ae7149de91bdf
4
- data.tar.gz: 3c6d5c0f2b4e7ca577ef151839cb7e379d3c1225
3
+ metadata.gz: 7c91f8b32f28201416c245f4abc5c8b43a162884
4
+ data.tar.gz: 4c4f753702c380296db4a0c87f3bc7b49d8123be
5
5
  SHA512:
6
- metadata.gz: 18441d6079bcc6f2cc1c3856f1cac76737e5c7c526f9d4cfe95d3975bb4df530e27e4062a06fcb4c34c60c83c43e1ce13d8ea242214320ae403661bbef1f841f
7
- data.tar.gz: dae27ab06cb87266794a67e7b3c86e8416a9430c7c6c15ef77f311c83f4f53bdd3d953ee0a5047939ba4ef5524a52dec3caaccbd86368ebcfe4f5f6faf7b236c
6
+ metadata.gz: 33cbf1b4bb552e2ef1e3639d3ef57a3759988e2cd4cb4f8b26ce76e29f7881756ed92e0fd9c0268aa10d7575f0edff4dd22102d47b0d7c26671d52e7ce0248e6
7
+ data.tar.gz: 36382456f0aedbb53356330f3a41467164cc09395478084b941b9f08cbb4835a9a827826c743ae354869dda6df13c4c5293367477ff630a70033e328fdf384e2
@@ -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
@@ -0,0 +1,15 @@
1
+ name: baps
2
+
3
+ up:
4
+ - ruby: 2.3.1
5
+ - bundler
6
+
7
+ commands:
8
+ test:
9
+ desc: 'run test(s)'
10
+ run: |
11
+ if [[ $# -eq 0 ]]; then
12
+ bin/rake
13
+ else
14
+ bundle exec ruby -Itest "$@"
15
+ fi
@@ -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
- url = "/api/v1/repos/shopify/public/package/#{type}/ubuntu/trusty/#{name}/#{arch}/#{version}/stats/downloads/count.json"
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
@@ -1,3 +1,3 @@
1
1
  module Baps
2
- VERSION = '0.1.3'
2
+ VERSION = '0.1.4'
3
3
  end
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.3
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-19 00:00:00.000000000 Z
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