claiss 1.0.6 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/claiss.rb +26 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7b117b78d9275e924380505e1ca1ddb0818490cd1532dd5a31de08b199e1b84
4
- data.tar.gz: 39ba11f151fe5ecd59cc291011ef8611e61f4a83cf4d95427bd3589643be7353
3
+ metadata.gz: 3a27c84097fb8adb9ce3e2351651821770f6973b000557e8566b79c24428b66c
4
+ data.tar.gz: 74a986701d5b7031cd6f0fdfc9a93d18df2801bd6f1474138a30200fad9c7c73
5
5
  SHA512:
6
- metadata.gz: 4265f73dadbbae241ca6d6dab87b121f5fc931c9f2044c8a159d52031c1b629eec97c4439dbd7879efbc48ad5bb6c36075d40cd8c7c3a5d12a87117d6b580efa
7
- data.tar.gz: b217629b6cc0da245dfe5e1e3b33123a22f52d7037b6c8900688d32291b730a75ef76152be7c059fce5bd2b9d7fb5c932f11fa098bab3355a22a28acb3d92c26
6
+ metadata.gz: 05af17263512ea15e08d4742d9e2ac8d0db3f2f1d2796f805372ce3afb76d3419b79d37c6566a857da75723e606fa402324baa89c8985df528eb0d8236d1ce8d
7
+ data.tar.gz: aa9387b2cf6f4bf87cdcb9424564c31a34af908fa5664fee85c4211f29d26dad09af20068fa08e50f957152adc57a2e4e07ed6309bb174675ce01478513bc41b
data/lib/claiss.rb CHANGED
@@ -13,7 +13,7 @@ module Claiss
13
13
 
14
14
  def call(*)
15
15
  spec = Gem::Specification::load("claiss.gemspec")
16
- puts "#{spec.summary}"
16
+ puts "#{spec.description}"
17
17
  puts "Version: #{spec.version}"
18
18
  end
19
19
  end
@@ -32,6 +32,7 @@ module Claiss
32
32
  origin_path = File.expand_path(path)
33
33
  destination_path = File.expand_path("."+ temp_dir)
34
34
 
35
+
35
36
  if !json_file.nil?
36
37
  jfile = File.read(json_file)
37
38
  dict = JSON.parse(jfile)
@@ -47,6 +48,9 @@ module Claiss
47
48
  input = STDIN.gets.chomp!
48
49
  end
49
50
  end
51
+
52
+ dict = {origin_path => destination_path}.merge(dict)
53
+ dict[origin_path] = destination_path
50
54
  source = File.expand_path(origin_path + "/**/*", __FILE__)
51
55
  Dir.glob(source).reject{ |f| File.directory?(f)}.each do |file_name|
52
56
  destination = file_name
@@ -63,11 +67,31 @@ module Claiss
63
67
  File.write(destination, text) if !File.directory?(file_name)
64
68
  puts "File: #{destination}, OK" if !File.directory?(file_name)
65
69
  end
66
- puts "done!"
67
70
 
71
+ puts "done! your project is in the #{temp_dir} folder"
68
72
  end
69
73
  end
70
74
 
75
+ class FixRubyPermissions < Dry::CLI::Command
76
+ argument :path, required: true, desc: "The path of your ruby project"
77
+
78
+ def call(path: nil, **)
79
+ if path.nil?
80
+ path = File.basename(Dir.getwd)
81
+ end
82
+
83
+ # Run shell scripts to set permissions.
84
+ directories = `chmod 755 $(find #{path} -type d)`
85
+ files = `chmod 644 $(find #{path} -type f)`
86
+ bundle = `chmod 755 #{path+'/bin/bundle'}`
87
+ rails = `chmod 755 #{path+'/bin/rails'}`
88
+ rake = `chmod 755 #{path+'/bin/rake'}`
89
+ spring = `chmod 755 #{path+'/bin/spring'}`
90
+ end
91
+ end
92
+
93
+
71
94
  register "version", Version, aliases: ["v", "-v", "--version"]
72
95
  register "refactor",Refactor
96
+ register "fix_ruby_permissions",FixRubyPermissions
73
97
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: claiss
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Júlio Papel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-07-02 00:00:00.000000000 Z
11
+ date: 2023-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-cli