optimal-ci 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b80163015f1f21fa19e5f62ee301ba5fc8d68840452c44f89c9f0d5518472d7d
4
- data.tar.gz: ec3d0567ba6225990dbb22ae6343b5b9360d840789feabca51e904b27ba7a4f2
3
+ metadata.gz: 2dc80539a7e54f44e4f76945a1a82d7068cdf6168a8473ab88ebac94c2a083b3
4
+ data.tar.gz: 21fd500ce95f28861002a915fd91c26253745ed5511ca332cc296077b0b60c88
5
5
  SHA512:
6
- metadata.gz: 3f99bca894a3bcf8d699b456f17fee7b9b9d96c9469b9d512dd37a4961336b1e1d51a8fbea3e4c1d2784a20eea3203715700bcf8c9cc656dd835eba5b6bbfc10
7
- data.tar.gz: 3d9266e0e829b2455dfc6d36662130dbcb45ca16d9d86c2ddce897cfa314a6eb11eed0237968c6ee1c557b038ada6d2bb351ea0ffb020458d8c3dd3c4b69bbdc
6
+ metadata.gz: 71b745d20d0e4bbd8253a04927964d464a3f3819053d25565fef73ce3fbcd8a48162e2aff99ef01abe7de355bc3ecc383250082db14463e607210d5688e96d63
7
+ data.tar.gz: d2310f3801cb6e0272a3ded4888e52edea3b177944b2460452b2bf39678bfbc54c03a0606078e7774a5c79c7e8de2f9988b5e7be4aac31dfa0b263abad1c8b6b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- optimal-ci (0.0.1)
4
+ optimal-ci (0.0.2)
5
5
  rest-client (~> 2.1.0)
6
6
 
7
7
  GEM
@@ -1,15 +1,23 @@
1
1
  module Optimal
2
2
  module CI
3
3
  class Queue
4
- def initialize(provider)
4
+ def initialize(provider, command_arguments_string = "")
5
5
  @provider = provider
6
+ @command_arguments_string = command_arguments_string
6
7
 
7
8
  raise "OPTIMAL_CI_URL is not valid ENV" if ENV['OPTIMAL_CI_URL'].nil?
8
9
  raise "OPTIMAL_CI_TOKEN is not valid ENV" if ENV['OPTIMAL_CI_TOKEN'].nil?
9
10
  end
10
11
 
11
12
  def push(files)
12
- response = ::RestClient.post(ENV['OPTIMAL_CI_URL'] + '/builds', {build_number: @provider.build_number, total_files: files, ci: @provider.name}, { Authorization: ENV['OPTIMAL_CI_TOKEN'] })
13
+ params = {
14
+ build_number: @provider.build_number,
15
+ total_files: files,
16
+ ci: @provider.name,
17
+ command_arguments_string: @command_arguments_string
18
+ }
19
+
20
+ response = ::RestClient.post(ENV['OPTIMAL_CI_URL'] + '/builds', params, { Authorization: ENV['OPTIMAL_CI_TOKEN'] })
13
21
 
14
22
  response.code == 204
15
23
  rescue RestClient::Conflict
@@ -2,6 +2,7 @@ module Optimal
2
2
  module CI
3
3
  class Runner
4
4
  def initialize(args = [])
5
+ @command_arguments_string = args.join(" ")
5
6
  @args = args
6
7
 
7
8
  if @args.empty?
@@ -13,7 +14,7 @@ module Optimal
13
14
 
14
15
  def run
15
16
  provider = Optimal::CI::Provider.detect
16
- queue = Optimal::CI::Queue.new(provider)
17
+ queue = Optimal::CI::Queue.new(provider, @command_arguments_string)
17
18
 
18
19
  queue.push(total_files)
19
20
 
@@ -1,5 +1,5 @@
1
1
  module Optimal
2
2
  module CI
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optimal-ci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mohsen Alizadeh