remocon 0.1.0 → 0.2.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
- SHA256:
3
- metadata.gz: b4880ea48bc2d1036aaa7ff6a2aecb5559b229e156362a5780c58ccaec9d2e52
4
- data.tar.gz: d8362315682a507256267c3127c4f56a152dc66a61bec218af9398e935166c2b
2
+ SHA1:
3
+ metadata.gz: 58b35965e13809b6a9cb50faf6687db01d97a654
4
+ data.tar.gz: d08d352a433fb43423893bc481736508e23781c3
5
5
  SHA512:
6
- metadata.gz: 2197306cb1c04a5e9b5635319a68694a7f8d559744ebb0e2d46e29c977a8f456722f6e1169eea5097919b829777d2c367fbe67bc2823f3d188b8bf8bca790f0e
7
- data.tar.gz: 8c538816d4cefe387361ec4e067a6ea5a04c664d994450e6567ad98263cbb93aa7e15fe94c4bbc355653056dc76335bfab232254f615eb65a8494410554d6496
6
+ metadata.gz: 94a3bdf29de030d03e4e6f63a7a6a61f14695d29cd8e4b82d6f2bf2e4042a92860e663125d152a6bd7bbef8671b891b9a741fa6f5b9511a040d98b5bb417e3c5
7
+ data.tar.gz: 6438d1ccd13cd73c6fee406c411c8dbc0b2018f5f39b39fbf5af3d02abe1483ae6e86fcf6bdc73e113a5761508bc6f97e27e801830ba2e07f336243c70226a2a
data/.gitignore CHANGED
@@ -311,3 +311,5 @@ modules.xml
311
311
 
312
312
 
313
313
  # End of https://www.gitignore.io/api/rubymine+all,rubymine+iml
314
+
315
+ firebase-adminsdk.json
@@ -1,70 +1,178 @@
1
+ # Defaults can be found here: https://github.com/bbatsov/rubocop/blob/master/config/default.yml
2
+
3
+ # If you don't like these settings, just delete this file :)
4
+
1
5
  AllCops:
2
6
  Exclude:
3
- - '*.gemspec'
4
7
  - 'vendor/**/*'
5
- - 'Gemfile'
6
- - 'Rakefile'
8
+ - 'spec/fixtures/**/*'
9
+ - 'tmp/**/*'
10
+ TargetRubyVersion: 2.3.7
7
11
 
8
- Style/Documentation:
12
+ Metrics/ModuleLength:
9
13
  Exclude:
10
14
  - 'spec/**/*'
11
- - 'test/**/*'
15
+ Enabled: true
12
16
 
13
- Metrics/LineLength:
14
- Max: 150
17
+ Style/StringLiterals:
18
+ EnforcedStyle: double_quotes
19
+ Enabled: true
20
+
21
+ # kind_of? is a good way to check a type
22
+ Style/ClassCheck:
23
+ EnforcedStyle: kind_of?
24
+
25
+ # It's better to be more explicit about the type
26
+ Style/BracesAroundHashParameters:
27
+ Enabled: false
28
+
29
+ # specs sometimes have useless assignments, which is fine
30
+ Lint/UselessAssignment:
15
31
  Exclude:
16
- - "spec/**/*"
32
+ - '**/spec/**/*'
33
+
34
+ # We could potentially enable the 2 below:
35
+ Layout/IndentHash:
36
+ Enabled: false
37
+
38
+ Layout/AlignHash:
39
+ Enabled: false
40
+
41
+ # HoundCI doesn't like this rule
42
+ Layout/DotPosition:
43
+ Enabled: false
44
+
45
+ # We allow !! as it's an easy way to convert ot boolean
46
+ Style/DoubleNegation:
47
+ Enabled: false
48
+
49
+ # Cop supports --auto-correct.
50
+ Lint/UnusedBlockArgument:
51
+ Enabled: false
52
+
53
+ # We want to allow class Fastlane::Class
54
+ Style/ClassAndModuleChildren:
55
+ Enabled: false
17
56
 
18
57
  Metrics/AbcSize:
58
+ Max: 60
59
+
60
+ # The %w might be confusing for new users
61
+ Style/WordArray:
62
+ MinSize: 19
63
+
64
+ # raise and fail are both okay
65
+ Style/SignalException:
19
66
  Enabled: false
20
67
 
21
- Metrics/ClassLength:
68
+ # Better too much 'return' than one missing
69
+ Style/RedundantReturn:
22
70
  Enabled: false
23
71
 
24
- Metrics/CyclomaticComplexity:
72
+ # Having if in the same line might not always be good
73
+ Style/IfUnlessModifier:
25
74
  Enabled: false
26
75
 
27
- Metrics/MethodLength:
76
+ # and and or is okay
77
+ Style/AndOr:
28
78
  Enabled: false
29
79
 
30
- Metrics/ModuleLength:
80
+ # Configuration parameters: CountComments.
81
+ Metrics/ClassLength:
82
+ Max: 350
83
+
84
+ Metrics/CyclomaticComplexity:
85
+ Max: 17
86
+
87
+ # Configuration parameters: AllowURI, URISchemes.
88
+ Metrics/LineLength:
89
+ Max: 370
90
+
91
+ # Configuration parameters: CountKeywordArgs.
92
+ Metrics/ParameterLists:
93
+ Max: 10
94
+
95
+ Metrics/PerceivedComplexity:
96
+ Max: 18
97
+
98
+ # Sometimes it's easier to read without guards
99
+ Style/GuardClause:
31
100
  Enabled: false
32
101
 
33
- Style/BracesAroundHashParameters:
102
+ # something = if something_else
103
+ # that's confusing
104
+ Style/ConditionalAssignment:
34
105
  Enabled: false
35
106
 
107
+ # Better to have too much self than missing a self
108
+ Style/RedundantSelf:
109
+ Enabled: false
110
+
111
+ Metrics/MethodLength:
112
+ Max: 60
113
+
114
+ # We're not there yet
36
115
  Style/Documentation:
37
116
  Enabled: false
38
117
 
39
- Style/EachWithObject:
118
+ # Adds complexity
119
+ Style/IfInsideElse:
40
120
  Enabled: false
41
121
 
42
- Style/LineEndConcatenation:
122
+ # danger specific
123
+
124
+ Style/BlockComments:
43
125
  Enabled: false
44
126
 
45
- Style/MutableConstant:
127
+ Layout/MultilineMethodCallIndentation:
128
+ EnforcedStyle: indented
129
+
130
+ # FIXME: 25
131
+ Metrics/BlockLength:
132
+ Max: 345
133
+ Exclude:
134
+ - "**/*_spec.rb"
135
+
136
+ Style/MixinGrouping:
46
137
  Enabled: false
47
138
 
48
- Style/NumericLiterals:
139
+ Style/FileName:
49
140
  Enabled: false
50
141
 
51
- Style/ParallelAssignment:
142
+ Layout/IndentHeredoc:
52
143
  Enabled: false
53
144
 
54
- Style/RedundantSelf:
145
+ Style/SpecialGlobalVars:
55
146
  Enabled: false
56
147
 
57
- Style/RegexpLiteral:
58
- Enabled: true
148
+ PercentLiteralDelimiters:
149
+ PreferredDelimiters:
150
+ "%": ()
151
+ "%i": ()
152
+ "%q": ()
153
+ "%Q": ()
154
+ "%r": "{}"
155
+ "%s": ()
156
+ "%w": ()
157
+ "%W": ()
158
+ "%x": ()
59
159
 
60
- Style/StringLiterals:
160
+ Security/YAMLLoad:
61
161
  Enabled: false
62
162
 
63
- Style/SymbolProc:
163
+ Style/TrailingCommaInArguments:
164
+ Enabled: true
165
+
166
+ Style/TrailingCommaInArrayLiteral:
64
167
  Enabled: false
65
168
 
66
- Style/UnneededPercentQ:
169
+ Style/TrailingCommaInHashLiteral:
67
170
  Enabled: false
68
171
 
69
- Style/PerlBackrefs:
172
+ Naming/HeredocDelimiterNaming:
173
+ Exclude:
174
+ - 'vendor/**/*'
175
+ - 'spec/**/*'
176
+
177
+ Security/Open:
70
178
  Enabled: false
@@ -1 +1 @@
1
- 2.5.0
1
+ 2.3.7
@@ -1,13 +1,18 @@
1
1
  sudo: false
2
2
  language: ruby
3
+
4
+ cache:
5
+ directories: vendor/bundle
6
+
3
7
  rvm:
4
- - 2.5.0
8
+ - 2.3.7
9
+ - 2.4.4
10
+ - 2.5.1
11
+
5
12
  env:
6
13
  global:
7
14
  - FIREBASE_PROJECT_ID='project_id'
8
15
  - REMOTE_CONFIG_ACCESS_TOKEN='token'
9
16
  before_install: gem install bundler -v 1.16.1
10
- install: bundle install --deployment --jobs=4 --retry=3
11
- cache:
12
- directories: vendor/bundle
17
+ install: bundle install --deployment --jobs=4 --retry=3 --path=vendor/bundle
13
18
  script: bundle exec rake spec
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
6
 
@@ -1,61 +1,63 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- remocon (0.1.0)
4
+ remocon (0.2.0)
5
5
  activesupport
6
6
  thor
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (5.1.5)
11
+ activesupport (5.2.1)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
- i18n (~> 0.7)
13
+ i18n (>= 0.7, < 2)
14
14
  minitest (~> 5.1)
15
15
  tzinfo (~> 1.1)
16
16
  ast (2.4.0)
17
17
  coderay (1.1.2)
18
18
  concurrent-ruby (1.0.5)
19
19
  diff-lcs (1.3)
20
- i18n (0.9.5)
20
+ i18n (1.1.0)
21
21
  concurrent-ruby (~> 1.0)
22
+ jaro_winkler (1.5.1)
22
23
  method_source (0.9.0)
23
24
  minitest (5.11.3)
24
25
  parallel (1.12.1)
25
- parser (2.5.0.4)
26
+ parser (2.5.1.2)
26
27
  ast (~> 2.4.0)
27
- powerpack (0.1.1)
28
+ powerpack (0.1.2)
28
29
  pry (0.11.3)
29
30
  coderay (~> 1.1.0)
30
31
  method_source (~> 0.9.0)
31
32
  rainbow (3.0.0)
32
33
  rake (10.5.0)
33
- rspec (3.7.0)
34
- rspec-core (~> 3.7.0)
35
- rspec-expectations (~> 3.7.0)
36
- rspec-mocks (~> 3.7.0)
37
- rspec-core (3.7.1)
38
- rspec-support (~> 3.7.0)
39
- rspec-expectations (3.7.0)
34
+ rspec (3.8.0)
35
+ rspec-core (~> 3.8.0)
36
+ rspec-expectations (~> 3.8.0)
37
+ rspec-mocks (~> 3.8.0)
38
+ rspec-core (3.8.0)
39
+ rspec-support (~> 3.8.0)
40
+ rspec-expectations (3.8.1)
40
41
  diff-lcs (>= 1.2.0, < 2.0)
41
- rspec-support (~> 3.7.0)
42
- rspec-mocks (3.7.0)
42
+ rspec-support (~> 3.8.0)
43
+ rspec-mocks (3.8.0)
43
44
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.7.0)
45
- rspec-support (3.7.1)
46
- rubocop (0.53.0)
45
+ rspec-support (~> 3.8.0)
46
+ rspec-support (3.8.0)
47
+ rubocop (0.58.2)
48
+ jaro_winkler (~> 1.5.1)
47
49
  parallel (~> 1.10)
48
- parser (>= 2.5)
50
+ parser (>= 2.5, != 2.5.1.1)
49
51
  powerpack (~> 0.1)
50
52
  rainbow (>= 2.2.2, < 4.0)
51
53
  ruby-progressbar (~> 1.7)
52
54
  unicode-display_width (~> 1.0, >= 1.0.1)
53
- ruby-progressbar (1.9.0)
55
+ ruby-progressbar (1.10.0)
54
56
  thor (0.20.0)
55
57
  thread_safe (0.3.6)
56
58
  tzinfo (1.2.5)
57
59
  thread_safe (~> 0.1)
58
- unicode-display_width (1.3.0)
60
+ unicode-display_width (1.4.0)
59
61
 
60
62
  PLATFORMS
61
63
  ruby
@@ -69,4 +71,4 @@ DEPENDENCIES
69
71
  rubocop
70
72
 
71
73
  BUNDLED WITH
72
- 1.16.1
74
+ 1.16.3
data/README.md CHANGED
@@ -7,19 +7,27 @@ Conditions and parameters are managed by YAML files.
7
7
 
8
8
  ## Usage
9
9
 
10
- You need to get an access token for your firebase project.
10
+ To get an access token, `bin/get_access_token <firebase adminsdk json>` would help you.
11
+
12
+ ### Get the current configs into your local
11
13
 
12
14
  ```bash
13
- export FIREBASE_PROJECT_ID='your project id'
14
- export REMOTE_CONFIG_ACCESS_TOKEN='your access token'
15
+ bundle exec remocon pull --prefix=projects --id=my_project_dev --token=xyz
15
16
  ```
16
17
 
17
- ### Get the current configs into your local
18
+ Then, you can see `paremeters.yml, conditions.yml, config.json, etag` files in `projects/my_project_dev` directory.
19
+ If you don't specify `--prefix`, then the command create the files in the working directory
20
+
21
+ *Environment variables*
22
+
23
+ Some variables can be injected by environment variables.
18
24
 
19
25
  ```bash
20
- bundle exec remocon pull --dest=${path to dir}
26
+ export REMOCON_FIREBASE_PROJECT_ID=<--id>
27
+ export REMOCON_FIREBASE_ACCESS_TOKEN=<--token>
28
+ export REMOCON_PREFIX=<--prefix> # Optional
21
29
 
22
- # you can see ${path to dir}/${FIREBASE_PROJECT_ID}/{paremeters.yml, conditions.yml, config.json, etag}
30
+ FIREBASE_PROJECT_ID and REMOTE_CONFIG_ACCESS_TOKEN are supported but they are deprecated now
23
31
  ```
24
32
 
25
33
  ### Edit configs on your local
@@ -52,7 +60,17 @@ key1: # key name
52
60
  ### Update configs on remote
53
61
 
54
62
  ```bash
55
- bundle exec remocon push --source=${path to a json file} --etag=${string or path to a file}
63
+ # Create new configs as projects/my_project_dev/config.json
64
+ bundle exec remocon create --prefix=projects --id=my_project_dev
65
+
66
+ # Upload projects/my_project_dev/config.json by using projects/my_project_dev/etag
67
+ bundle exec remocon push --prefix=projects --id=my_project_dev --token=xyz
68
+
69
+ # You can use custom paths for config.json and etag
70
+ bundle exec remocon push --source=</path/to/config json> --etag=</path/to/etag>
71
+
72
+ # Use the fixed etag value
73
+ bundle exec remocon push --raw_etag=<raw etag value>
56
74
  ```
57
75
 
58
76
  ## Installation
@@ -82,6 +100,10 @@ key:
82
100
 
83
101
  It seems only three fields are supported by Remote Config. They are name, expression and tagColor.
84
102
 
103
+ ## Supported Ruby Version
104
+
105
+ Not EOL versions. ref https://www.ruby-lang.org/en/downloads/branches/
106
+
85
107
  ## Contributing
86
108
 
87
109
  Bug reports and pull requests are welcome on GitHub at https://github.com/jmatsu/remocon .
data/Rakefile CHANGED
@@ -1,6 +1,19 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rspec/core/rake_task"
5
+ require "rubocop/rake_task"
6
+
7
+ RSpec::Core::RakeTask.new(:specs)
8
+
9
+ task default: :specs
3
10
 
4
- RSpec::Core::RakeTask.new(:spec)
11
+ task :spec do
12
+ Rake::Task["specs"].invoke
13
+ Rake::Task["rubocop"].invoke
14
+ end
5
15
 
6
- task :default => :spec
16
+ desc "Run RuboCop on the lib/specs directory"
17
+ RuboCop::RakeTask.new(:rubocop) do |task|
18
+ task.patterns = ["lib/**/*.rb", "spec/**/*.rb"]
19
+ end
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'remocon'
4
+ require "bundler/setup"
5
+ require "remocon"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'remocon'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start(__FILE__)