yamlfish 0.1.0.alpha1 → 0.1.0.alpha2

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: 5aa65ba0ad01cac58be18f2ff437609fa1c7009e586be2bf16e9a2828b80f8fa
4
- data.tar.gz: 550c2d63e56849b9efa83e05f73b84f983026233f378beab1287096939c88480
3
+ metadata.gz: d12427d97a7ae3df74fd9eb9506e000bd5d4769c9d3e8c3bf403c03eebae4b40
4
+ data.tar.gz: 1a5ce410afd9e1944b42d9b8840ad48a4980537aa19be9bbe5cc7f53139e0806
5
5
  SHA512:
6
- metadata.gz: bef480f8b6fed17353e2b1e46f7894b54f0b16eca8c37e379f4b805fc804c042bfe4b33338edf454adc0e3c3cfc167b1637ff59a1821730c7b492c41fc292060
7
- data.tar.gz: 3dc0cfed2cf7b244b924a3a4485aa081b3f640e5f232393da93db46e2aa38ac200d02a8c7bab416b6cdd06c1b3e5ffabbe0d61c0af230516fed7a9c7bde99f7e
6
+ metadata.gz: 1441f3a45996505674ca21af113a5b4704da38de26b599f1afa35244d598f57358aecbd6546ddc6fc48e9bf9c12c57541cc2a907f879bd412bf6823a49f26be7
7
+ data.tar.gz: 445bb5b1a86a9b7c43cd8f64f8987944e50517f7579d3d7b5a499c9ed849ca188b99986fb14fb7e0c5902bf4357b428ff8d637e10da97f629386195bf318a36f
data/Gemfile.lock CHANGED
@@ -4,6 +4,7 @@ PATH
4
4
  yamlfish (0.1.0.alpha1)
5
5
  activesupport (>= 6)
6
6
  faraday (~> 2.0)
7
+ rainbow (~> 3.1)
7
8
  thor (~> 1.2)
8
9
 
9
10
  GEM
@@ -36,6 +37,7 @@ GEM
36
37
  mutex_m (0.2.0)
37
38
  net-http (0.4.1)
38
39
  uri
40
+ rainbow (3.1.1)
39
41
  rake (13.0.6)
40
42
  rspec (3.12.0)
41
43
  rspec-core (~> 3.12.0)
@@ -25,12 +25,20 @@ module Yamlfish
25
25
  "Authorization": "Bearer #{Yamlfish::Cli.configuration.api_key}"
26
26
  }
27
27
  )
28
+
29
+ if response.status != 200
30
+ puts Rainbow("Failed to pull, unexpected HTTP status #{response.status}").red.bright
31
+ return
32
+ end
33
+
28
34
  translations = JSON.parse(response.body)
29
35
 
30
36
  if @inplace
31
37
  replace_inplace(translations)
38
+ puts "Fetched translations in-place for locale #{Rainbow(@locale_identifier).magenta.bright}"
32
39
  else
33
40
  dump_translations(translations)
41
+ puts "Downloaded new translations for locale #{Rainbow(@locale_identifier).magenta.bright}"
34
42
  end
35
43
  end
36
44
 
@@ -27,7 +27,11 @@ module Yamlfish
27
27
  "Authorization": "Bearer #{Yamlfish::Cli.configuration.api_key}"
28
28
  }
29
29
  )
30
- puts response.status
30
+ if response.status == 201
31
+ puts "Successfully pushed translations for locale #{Rainbow(@locale_identifier).magenta.bright} on branch #{Rainbow(@branch).magenta.bright}"
32
+ else
33
+ puts Rainbow("Failed to push, unexpected HTTP status #{response.status}").red.bright
34
+ end
31
35
  end
32
36
  end
33
37
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Yamlfish
4
4
  module Cli
5
- VERSION = "0.1.0.alpha1"
5
+ VERSION = "0.1.0.alpha2"
6
6
  end
7
7
  end
data/lib/yamlfish/cli.rb CHANGED
@@ -4,6 +4,7 @@ require_relative "cli/version"
4
4
  require_relative "cli/push"
5
5
  require_relative "cli/pull"
6
6
  require "yaml"
7
+ require "rainbow"
7
8
 
8
9
  module Yamlfish
9
10
  module Cli
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yamlfish
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha1
4
+ version: 0.1.0.alpha2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrien Siami
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-02-18 00:00:00.000000000 Z
11
+ date: 2024-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rainbow
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '3.1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '3.1'
55
69
  description:
56
70
  email:
57
71
  - adrien@siami.fr