template_creator 0.0.1

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/template_creator.rb +58 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 06a9eca5ce81b0a0cbc3ac8c6e5586a3809951c6ed231a0035a4eed7481aff95
4
+ data.tar.gz: c91796ecd64f544fbbf8f6af47719c28621e22714a68f8809a434f324ec78573
5
+ SHA512:
6
+ metadata.gz: bb07d95a400698f097ae0000b7c6cf817a1c92918512314e40ee3aea766956fb4a39c57f81167e0b50c9a77356a480157ba92e8a4d7d2cf9a607c905ba2b1223
7
+ data.tar.gz: 7e096d08a4fb3ed93d56a61a3ddde67126bdcdf4a49a21a8488d84877e3c13b3cc901cfa16bd6a60a07b414acccf87883667562e072cdd6fa58d83ab8258b676
@@ -0,0 +1,58 @@
1
+ class CookieGem
2
+ =begin
3
+ A cookiclutter for making the ruby gems, provide the variables
4
+ as you want in your ruby gemspec file and it will write the gem
5
+ specific file. You can then directly build your gems using the
6
+ gem build gemfilename.gemspec
7
+ filenamewrite = file to which the template should be written
8
+ authors = authors of the template
9
+ rubyfilename = name of the ruby file
10
+ name = package name
11
+ summary = summary of the package
12
+ version = version of the package
13
+ email = email of the author
14
+ homepage = homepage of the package
15
+ license = licence type
16
+ metadata = metadata of the package
17
+ =end
18
+ def initialize(authors, rubyfilename, name, summary, version, email, homepage, license, metadata)
19
+ @storingauthor = authors.to_s
20
+ @storingfiles = rubyfilename.split
21
+ @storingname = name
22
+ @storingsummary = summary
23
+ @storingversion = version
24
+ @storingemail = email
25
+ @storinghomepage = homepage
26
+ @storinglicense = license
27
+ @storingmetadata = metadata
28
+ #{}@largemetadata = File.open(metadata).readlines().each{ |each| puts each.split("\n").join}
29
+ end
30
+ def templateMaker
31
+ puts "Gem::Specification.new.do |s|"
32
+ puts "s.author = #{@storingauthor}"
33
+ puts "s.files = #{@storingfiles}"
34
+ puts "s.name = #{@storingname}"
35
+ puts "s.summary = #{@storingsummary}"
36
+ puts "s.version = #{@storingversion}"
37
+ puts "s.email = #{@storingemail}"
38
+ puts "s.homepage = #{@storinghomepage}"
39
+ puts "s.license = #{@storinglicense}"
40
+ puts "s.metadata = #{@storingmetadata}"
41
+ puts "s.metadata = #{@largemetadata}"
42
+ end
43
+ def writeTemplate(filename)
44
+ @file = filename
45
+ @firstline = "Gem::Specification.new.do |s|"
46
+ @writestoringauthor = "s.author = #{@storingauthor}"
47
+ @writestoringfiles = "s.files = #{@storingfiles}"
48
+ @writestoringname = "s.name = #{@storingname}"
49
+ @writestoringversion = "s.version = #{@storingversion}"
50
+ @writestoringsummary = "s.summary = #{@storingsummary}"
51
+ @writestoringemail = "s.email = #{@storingemail}"
52
+ @writestoringhomepage = "s.homepage = #{@storinghomepage}"
53
+ @writestoringlicense = "s.metadata = #{@storinglicense}"
54
+ @writestoringmetadata = "s.metadata = #{@storingmetadata}"
55
+ @writestoringlargemetadata = "s.metadata = #{@largemetadata}"
56
+ File.write("#{@file}"+".gemspec", "#{@file}\n#{@firstline}\n#{@writestoringauthor}\n#{@writestoringfiles}\n#{@writestoringname}\n#{@writestoringversion}\n#{@writestoringsummary}\n#{@writestoringemail}\n#{@writestoringhomepage}\n#{@writestoringlicense}\n#{@writestoringmetadata}\n#{@writestoringlargemetadata}", mode: "a")
57
+ end
58
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: template_creator
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Gaurav Sablok
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2023-09-01 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email:
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/template_creator.rb
20
+ homepage: https://github.com/sablokgaurav/ruby_gem_creator
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubygems_version: 3.4.19
40
+ signing_key:
41
+ specification_version: 4
42
+ summary: Generates the template files for the gem development. has two functions one
43
+ to create a template and one to write a template
44
+ test_files: []