skeletoruby 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 426574639aac92f45006effb1778a3d8cabbe2e1cf169e33ef0a03e765c1da89
4
+ data.tar.gz: 467ce5e5bd46c81651a874c816bbbdc1000a0c86cadb1fbb3d55afbe54ddb0cf
5
+ SHA512:
6
+ metadata.gz: 1da19c2bd8f97d2d6afa45d113c772b053384ee1fad45326ed622465cf6fe1b7c82828326ea6a6e24ba93a39ccb6faa60541df47e89c06b4713d5ddb746eca2a
7
+ data.tar.gz: 6ef058f755cb4df450e974de8cdca7cf178f40fbcba5837abc6882fed69bb72fab728d38dd3b8fe38bfd64b22cb18fede0328e6a7f4ac0de1eae6683dc9883fb
data/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # SKELETORUBY
2
+
3
+ Ruby gem that builds a basic folder structure for a plain ruby project.
4
+
5
+ **folder structure**
6
+ ```
7
+ -Project-Name
8
+ --bin
9
+ --lib
10
+ --rspec
11
+ Gemfile
12
+ README.md
13
+ ```
14
+
15
+ ## How to use
16
+
17
+ Install the gem:
18
+
19
+ `gem install skeletoruby`
20
+
21
+ Example bash command:
22
+
23
+ `skeletoruby new project-name`
24
+
data/bin/skeletoruby ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'thor'
4
+ require_relative '../lib/skeletoruby/thor_commands'
5
+
6
+ Skeletoruby::ThorCommands.start
@@ -0,0 +1,12 @@
1
+ require 'fileutils'
2
+
3
+ module Skeletoruby
4
+ module Commands
5
+ class CreateBin
6
+ def self.call(project_name)
7
+ FileUtils.mkdir_p("#{project_name}/bin")
8
+ FileUtils.touch("#{project_name}/bin/.keep")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ require 'fileutils'
2
+
3
+ module Skeletoruby
4
+ module Commands
5
+ class CreateGemfile
6
+ def self.call(project_name)
7
+ FileUtils.touch("#{project_name}/Gemfile")
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,12 @@
1
+ require 'fileutils'
2
+
3
+ module Skeletoruby
4
+ module Commands
5
+ class CreateLib
6
+ def self.call(project_name)
7
+ FileUtils.mkdir_p("#{project_name}/lib")
8
+ FileUtils.touch("#{project_name}/lib/.keep")
9
+ end
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ require 'fileutils'
2
+
3
+ module Skeletoruby
4
+ module Commands
5
+ class CreateReadme
6
+ def self.call(project_name)
7
+ FileUtils.touch("#{project_name}/README.md")
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ require 'fileutils'
2
+
3
+ module Skeletoruby
4
+ module Commands
5
+ class InitializeRspec
6
+ def self.call(project_name)
7
+ FileUtils.cd("#{project_name}") { `rspec --init` }
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module Skeletoruby
2
+ module Commands
3
+ class PrepareGemfile
4
+ def self.call(project_name)
5
+ File.open("#{project_name}/Gemfile", "w") { |file| file.puts "source 'https://rubygems.org'" }
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Skeletoruby
2
+ module Commands
3
+ class PrepareReadme
4
+ def self.call(project_name)
5
+ File.open("#{project_name}/README.md", "w") { |file| file.puts "## #{project_name.upcase}" }
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,33 @@
1
+ require_relative './commands/create_bin'
2
+ require_relative './commands/create_lib'
3
+ require_relative './commands/create_gemfile'
4
+ require_relative './commands/create_readme'
5
+ require_relative './commands/initialize_rspec'
6
+ require_relative './commands/prepare_gemfile'
7
+ require_relative './commands/prepare_readme'
8
+
9
+ module Skeletoruby
10
+ class SkeletonBuilder
11
+ def self.build(project_name)
12
+ commands = [
13
+ Skeletoruby::Commands::CreateBin,
14
+ Skeletoruby::Commands::CreateLib,
15
+ Skeletoruby::Commands::CreateGemfile,
16
+ Skeletoruby::Commands::CreateReadme,
17
+ Skeletoruby::Commands::InitializeRspec,
18
+ Skeletoruby::Commands::PrepareGemfile,
19
+ Skeletoruby::Commands::PrepareReadme
20
+ ]
21
+
22
+ new(project_name).call(commands)
23
+ end
24
+
25
+ def initialize(project_name)
26
+ @project_name = project_name
27
+ end
28
+
29
+ def call(commands = [])
30
+ commands.each { |command| command.call(@project_name) }
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,14 @@
1
+ require_relative './skeleton_builder'
2
+
3
+ module Skeletoruby
4
+ class ThorCommands < Thor
5
+ desc 'new [Project]', 'It builds a ruby folder structure for a new project'
6
+ def new(project_name)
7
+ puts "Project (#{project_name}) is building..."
8
+
9
+ Skeletoruby::SkeletonBuilder.build(project_name)
10
+
11
+ say 'Done.'
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ module Skeletoruby
2
+ VERSION = '0.0.1'.freeze
3
+ end
@@ -0,0 +1 @@
1
+ require 'skeletoruby/skeleton_builder'
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: skeletoruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Alex Avlonitis
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2019-04-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rspec
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Saves time in creating folder structures for simple plain ruby projects
42
+ email: avlonitis@msn.com
43
+ executables:
44
+ - skeletoruby
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - README.md
49
+ - bin/skeletoruby
50
+ - lib/skeletoruby.rb
51
+ - lib/skeletoruby/commands/create_bin.rb
52
+ - lib/skeletoruby/commands/create_gemfile.rb
53
+ - lib/skeletoruby/commands/create_lib.rb
54
+ - lib/skeletoruby/commands/create_readme.rb
55
+ - lib/skeletoruby/commands/initialize_rspec.rb
56
+ - lib/skeletoruby/commands/prepare_gemfile.rb
57
+ - lib/skeletoruby/commands/prepare_readme.rb
58
+ - lib/skeletoruby/skeleton_builder.rb
59
+ - lib/skeletoruby/thor_commands.rb
60
+ - lib/skeletoruby/version.rb
61
+ homepage: https://github.com/AlexAvlonitis/skeletoruby
62
+ licenses:
63
+ - MIT
64
+ metadata: {}
65
+ post_install_message:
66
+ rdoc_options: []
67
+ require_paths:
68
+ - lib
69
+ required_ruby_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
74
+ required_rubygems_version: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - ">="
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 2.7.6
82
+ signing_key:
83
+ specification_version: 4
84
+ summary: Builds a simple ruby folder structure
85
+ test_files: []