updater_gf 0.1.4 → 0.1.5

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: f4b33e8d348342aaccef2c41bc4e916ee686a8f8e9138cc6c01519b9a0149f48
4
- data.tar.gz: 73a42363f12fcac20f7e73298014d5c0eebdf2114801e457d1a61faf6edb24bf
3
+ metadata.gz: d0cdb5b9fbaed3840ed593dfdf022bb18fbf8c819249a6152fa249aa57e508f0
4
+ data.tar.gz: 45a6bf94454c9748bec3434bf59f244d69881186a3664e6b85cb58526f0221dc
5
5
  SHA512:
6
- metadata.gz: c05a21f8bf024374644017403652125884dfd57513cc7fd0c757cd310b867ef547edc730ec2c05fee57f45981c61c76321c0ddcd9aedd122ca59ecd6e7442e9f
7
- data.tar.gz: f30e2d1ab33c840ccc1b3800e339d312f649f0e147b2a0a5b42d0c4147be79984722f41d2cbaf87f4fe11fe08b01d42374ada98bc1cb30158548deb808344c47
6
+ metadata.gz: a689d4eb0a8aca20608bc1ba0397b0758921766b83eefec01014cda9236aa0c15d3dac88c22bc0fff0a5efa03e71582a14083f5ea4ec31b9328ac3b20ba80871
7
+ data.tar.gz: 9135360b5b50decd9a9ac4b35dc1681599f270f1cf1727de148316668e12d276c545d9bd12f3c45aa2fd34987aa4bff22f5935cefe283d61140d7e3228a02bc4
data/CHANGELOG.md CHANGED
@@ -3,3 +3,26 @@
3
3
  ## [0.1.0] - 2024-10-23
4
4
 
5
5
  - Initial release
6
+
7
+ ## [0.1.1] - 2024-10-23
8
+
9
+ - Update fix bug
10
+ ## [0.1.2] - 2024-10-23
11
+
12
+ - Update fix bug
13
+
14
+ ## [0.1.3] - 2024-10-23
15
+
16
+ - Update fix bug
17
+
18
+ ## [0.1.4] - 2024-10-23
19
+
20
+ - Update add gem to use additional properties in command: updater_gf -a
21
+ - Update common .rubocop.yml file with command: updater_gf -a -r
22
+
23
+ ## [0.1.5] - 2024-10-23
24
+
25
+ -Update customizable parameters
26
+ - updater_gf -a or
27
+ - updater_gf -r or
28
+ - updater_gf -a -r
data/README.md CHANGED
@@ -29,6 +29,10 @@ after install gem
29
29
  open Terminal and go to directory of project run:
30
30
  $ updater_gf
31
31
 
32
+ options: '-a and -r'
33
+ "'-a' will add commonly used gems";
34
+ "'-r' will update rubocop file"
35
+
32
36
  ## Contributing
33
37
 
34
38
  Bug reports and pull requests are welcome on GitHub at https://github.com/devhoanglv92/updater_gf. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/devhoanglv92/updater_gf/blob/master/CODE_OF_CONDUCT.md).
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UpdaterGf
4
- VERSION = '0.1.4'
4
+ VERSION = '0.1.5'
5
5
  end
data/lib/updater_gf.rb CHANGED
@@ -9,7 +9,36 @@ module UpdaterGf
9
9
  class Updater
10
10
  class << self
11
11
  def run(add_gem = '', add_robocop = '')
12
- HandleUpdate.new(add_gem == '-a', add_robocop == '-r').process
12
+ if check_argv_error?(add_gem, add_robocop)
13
+ show_message_argv_error
14
+ return
15
+ end
16
+
17
+ is_add_gem = add_gem?(add_gem)
18
+ is_add_robocop = add_robocop?(add_gem, add_robocop)
19
+ HandleUpdate.new(is_add_gem, is_add_robocop).process
20
+ end
21
+
22
+ def add_gem?(add_gem)
23
+ add_gem.present? && add_gem == '-a'
24
+ end
25
+
26
+ def add_robocop?(add_gem, add_robocop)
27
+ (add_robocop.present? && add_robocop == '-r') || (add_gem.present? && add_gem == '-r')
28
+ end
29
+
30
+ def check_argv_error?(add_gem, add_robocop)
31
+ return true if add_gem.present? && (add_gem != '-a' || add_gem != '-r')
32
+ return true if add_robocop.present? && add_robocop != '-r'
33
+
34
+ false
35
+ end
36
+
37
+ def show_message_argv_error
38
+ puts 'Invalid arguments'
39
+ puts 'Usage: updater_gf [-a] [-r]'
40
+ puts ' -a: Add gems from list_gems_add to Gemfile'
41
+ puts ' -r: Add .rubocop.yml to project root'
13
42
  end
14
43
  end
15
44
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: updater_gf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - devhoanglv92
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-23 00:00:00.000000000 Z
11
+ date: 2024-10-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: update Gemfile and clean code file by updater_gf
14
14
  email: