just_the_gem 0.0.2 → 0.0.4
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 +4 -4
- data/bin/just_the_gem +18 -0
- data/lib/just_the_gem.rb +34 -7
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb14aa88a5acbe2955fdd31e3a86975f02fd58c45d8f097b3004ccbfd962ef79
|
4
|
+
data.tar.gz: 946da30dfc79a4ae9951d9cb930880d80819bd9264107ad2a0aca50d8e6c8389
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0adee39b7fd585cd7005b41dccfd2fe9a9e740b77c0020bc8851eba883536cd7ba7a11554ae435815684dafb1223cd5a9c8de965a49e9c1147a56d9df9686ee5
|
7
|
+
data.tar.gz: fdffd21ab940e6b46ffff8a9c896dc8e44e3143faac95f56b6f927500b62e9ba925fc27535766285d5a48187519316eab69e28afbe21aa4c76dbd1c6c38d461e
|
data/bin/just_the_gem
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
def gem_name
|
4
|
+
unless (gem_name = $*[1])
|
5
|
+
puts 'Please specify the name of the gem like so: just_the_gem test_gem'
|
6
|
+
exit
|
7
|
+
end
|
8
|
+
|
9
|
+
gem_name
|
10
|
+
end
|
11
|
+
|
12
|
+
def main
|
13
|
+
include JustTheGem
|
14
|
+
|
15
|
+
create(gem_name: gem_name)
|
16
|
+
end
|
17
|
+
|
18
|
+
main()
|
data/lib/just_the_gem.rb
CHANGED
@@ -1,12 +1,39 @@
|
|
1
|
-
|
1
|
+
module JustTheGem
|
2
|
+
def create(gem_name:)
|
3
|
+
abort 'Please specify the gem name' if gem_name.empty?
|
2
4
|
|
3
|
-
|
4
|
-
|
5
|
+
create_dirs(gem_name:)
|
6
|
+
create_files(gem_name:)
|
7
|
+
write_gem_spec(gem_name:)
|
8
|
+
end
|
9
|
+
|
10
|
+
def create_dirs(gem_name:)
|
11
|
+
Dir.mkdir(gem_name)
|
12
|
+
Dir.mkdir("#{gem_name}/lib")
|
13
|
+
Dir.mkdir("#{gem_name}/test")
|
14
|
+
end
|
15
|
+
|
16
|
+
def create_files(gem_name:)
|
17
|
+
File.create("lib/#{gem_name}.rb")
|
18
|
+
File.create("test/test_#{gem_name}.rb")
|
19
|
+
end
|
20
|
+
|
21
|
+
def write_gem_spec(gem_name:)
|
22
|
+
IO.write("#{gem_name}.gemspec", gem_spec_contents(gem_name:))
|
23
|
+
end
|
5
24
|
|
6
|
-
def
|
7
|
-
|
8
|
-
|
25
|
+
def gem_spec_contents(gem_name:)
|
26
|
+
<<~RUBY
|
27
|
+
Gem::Specification.new do |specification|
|
28
|
+
specification.authors = ['Your name here', 'Shkumbin Delija']
|
29
|
+
specification.files = Dir['lib/**/*.rb']
|
30
|
+
specification.name = '#{gem_name}'
|
31
|
+
specification.summary = 'This gem does #{gem_name}'
|
32
|
+
specification.version = '0.0.1'
|
33
|
+
# specification.homepage = 'https://github.com/ShkumbinDelija/just_the_gem'
|
34
|
+
# specification.metadata = { 'source_code_uri' => 'https://github.com/ShkumbinDelija/just_the_gem' }
|
35
|
+
end
|
36
|
+
RUBY
|
9
37
|
end
|
10
38
|
end
|
11
39
|
|
12
|
-
JustTheGem.start(ARGV)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: just_the_gem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shkumbin Delija
|
@@ -12,10 +12,12 @@ date: 2023-02-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|
15
|
-
executables:
|
15
|
+
executables:
|
16
|
+
- just_the_gem
|
16
17
|
extensions: []
|
17
18
|
extra_rdoc_files: []
|
18
19
|
files:
|
20
|
+
- bin/just_the_gem
|
19
21
|
- lib/just_the_gem.rb
|
20
22
|
homepage: https://github.com/ShkumbinDelija/just_the_gem
|
21
23
|
licenses: []
|