boostx 0.0.2 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/arfo90/boost.svg?branch=master)](https://travis-ci.org/arfo90/boost)
1
+ [![Build Status](https://travis-ci.org/arfo90/boostx.svg?branch=master)](https://travis-ci.org/arfo90/boostx)
2
2
 
3
3
  # Boost
4
4
 
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ $LOAD_PATH.unshift(File.dirname(File.realpath(__FILE__)) + '/../lib')
5
+
6
+ require 'boostx/cli'
7
+
8
+ Boostx::Cli.start(ARGV)
@@ -10,5 +10,14 @@ module Boostx
10
10
 
11
11
  module Core
12
12
  autoload :Builder, 'boostx/core/builder.rb'
13
+ autoload :Template, 'boostx/core/template.rb'
14
+ end
15
+
16
+ module Version
17
+ autoload :Version, 'boostx/version.rb'
13
18
  end
14
19
  end
20
+
21
+ # for debuging and testing locally
22
+ # can exec command ./boostx init pro_name
23
+ # Boostx::Cli.start(ARGV)
@@ -1,28 +1,12 @@
1
1
  require 'thor'
2
+ require_relative 'core/builder'
2
3
 
3
4
  module Boostx
4
5
  class Cli < Thor
5
- def initialize
6
- @builder = Boostx::Core::Builder.new
7
- end
8
-
9
6
  desc 'initializing project base', '--init'
10
7
  def init(project_name)
11
- @builder.init(project_name)
8
+ builder = Boostx::Core::Builder.new
9
+ builder.init(project_name)
12
10
  end
13
11
  end
14
12
  end
15
-
16
- #
17
- # require 'thor'
18
- #
19
- # class MyCli < Thor
20
- # desc 'hello, just test', 'say hello'
21
- # option :from
22
- # def hello(name)
23
- # puts name
24
- # puts "from #{options[:from]}" if options[:from]
25
- # end
26
- # end
27
- #
28
- # MyCli.start(ARGV)
@@ -1,4 +1,11 @@
1
+ begin
2
+ require 'psych'
3
+ rescue ::LoadError
4
+ end
5
+
1
6
  require 'fileutils'
7
+ require 'yaml/store'
8
+ require_relative 'template'
2
9
 
3
10
  module Boostx
4
11
  module Core
@@ -7,7 +14,7 @@ module Boostx
7
14
  FileUtils::mkdir_p folder_name
8
15
  end
9
16
 
10
- def make_file(file_name, path = Dir.pwd, extension = '.rb')
17
+ def make_file(file_name, path = Dir.pwd, extension = '.rb', content = nil)
11
18
  unless File.directory?(path)
12
19
  self.make_dir(path)
13
20
  end
@@ -21,6 +28,7 @@ module Boostx
21
28
  path << "#{file_name}#{extension}"
22
29
 
23
30
  new_file = File.new(path, 'w')
31
+ new_file.write(content) unless content.nil?
24
32
  new_file.close
25
33
  end
26
34
 
@@ -29,8 +37,27 @@ module Boostx
29
37
  directions.each do |dir|
30
38
  self.make_dir(dir)
31
39
  end
32
- make_file("#{project_name}", 'lib')
33
40
  make_file('Gemfile', Dir.pwd, '')
41
+
42
+
43
+ create_yaml(project_name)
44
+ create_module(project_name)
45
+ end
46
+
47
+ private
48
+
49
+ def create_module(project_name)
50
+ module_content = Boostx::Core::Template.base_module_struc(project_name.capitalize)
51
+ make_file("#{project_name}", 'lib', '.rb', module_content.to_s)
52
+ end
53
+
54
+ def create_yaml(project_name = nil)
55
+ yaml_file = YAML::Store.new '.boostx'
56
+ yaml_file.transaction do
57
+ yaml_file['project_name'] = project_name
58
+ yaml_file['module_name'] = project_name
59
+ yaml_file['module_dir'] = "#{Dir.pwd}/lib/#{project_name}"
60
+ end
34
61
  end
35
62
  end
36
63
  end
@@ -0,0 +1,26 @@
1
+ module Boostx
2
+ module Core
3
+ class Template
4
+ def self.base_module_struc(project_name)
5
+ basic_module = String.new
6
+ pre_require = module_require
7
+ module_require.each do |req|
8
+ basic_module << req+"\n"
9
+ end
10
+ basic_module << "\n"
11
+ basic_module << "module #{project_name}\n"
12
+ basic_module << "\s## autoload classes here\nend"
13
+ basic_module
14
+ end
15
+
16
+ def self.module_require
17
+ pre_module_require = []
18
+ pre_module_require << "$LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__))"
19
+ pre_module_require << "require 'rubygems'"
20
+ pre_module_require << "require 'bundler/setup'"
21
+ pre_module_require << "Bundler.require(:default)"
22
+ pre_module_require
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,20 @@
1
+ # encoding: utf-8
2
+
3
+ module Boostx
4
+ module Version
5
+ STRING = '0.0.6'
6
+
7
+ MSG = '%s (using Parser %s, running on %s %s %s)'
8
+
9
+ module_function
10
+
11
+ def version(debug = false)
12
+ if debug
13
+ format(MSG, STRING, Parser::VERSION,
14
+ RUBY_ENGINE, RUBY_VERSION, RUBY_PLATFORM)
15
+ else
16
+ STRING
17
+ end
18
+ end
19
+ end
20
+ end
metadata CHANGED
@@ -1,133 +1,151 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boostx
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.6
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Amireza Fatemi
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-10-31 00:00:00.000000000 Z
12
+ date: 2015-11-30 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: thor
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
- - - ">"
19
+ - - ! '>'
18
20
  - !ruby/object:Gem::Version
19
21
  version: 0.19.0
20
22
  type: :runtime
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
- - - ">"
27
+ - - ! '>'
25
28
  - !ruby/object:Gem::Version
26
29
  version: 0.19.0
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: bundler
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
- - - "~>"
35
+ - - ~>
32
36
  - !ruby/object:Gem::Version
33
37
  version: '1.7'
34
38
  type: :development
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
- - - "~>"
43
+ - - ~>
39
44
  - !ruby/object:Gem::Version
40
45
  version: '1.7'
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: rake
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
- - - "~>"
51
+ - - ~>
46
52
  - !ruby/object:Gem::Version
47
53
  version: '10.0'
48
54
  type: :development
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
- - - "~>"
59
+ - - ~>
53
60
  - !ruby/object:Gem::Version
54
61
  version: '10.0'
55
62
  - !ruby/object:Gem::Dependency
56
63
  name: minitest
57
64
  requirement: !ruby/object:Gem::Requirement
65
+ none: false
58
66
  requirements:
59
- - - "~>"
67
+ - - ~>
60
68
  - !ruby/object:Gem::Version
61
69
  version: 5.8.1
62
70
  type: :development
63
71
  prerelease: false
64
72
  version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
65
74
  requirements:
66
- - - "~>"
75
+ - - ~>
67
76
  - !ruby/object:Gem::Version
68
77
  version: 5.8.1
69
78
  - !ruby/object:Gem::Dependency
70
79
  name: mocha
71
80
  requirement: !ruby/object:Gem::Requirement
81
+ none: false
72
82
  requirements:
73
- - - "~>"
83
+ - - ~>
74
84
  - !ruby/object:Gem::Version
75
85
  version: 1.1.0
76
86
  type: :development
77
87
  prerelease: false
78
88
  version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
79
90
  requirements:
80
- - - "~>"
91
+ - - ~>
81
92
  - !ruby/object:Gem::Version
82
93
  version: 1.1.0
83
94
  - !ruby/object:Gem::Dependency
84
95
  name: fakefs
85
96
  requirement: !ruby/object:Gem::Requirement
97
+ none: false
86
98
  requirements:
87
- - - "~>"
99
+ - - ~>
88
100
  - !ruby/object:Gem::Version
89
101
  version: 0.6.7
90
102
  type: :development
91
103
  prerelease: false
92
104
  version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
93
106
  requirements:
94
- - - "~>"
107
+ - - ~>
95
108
  - !ruby/object:Gem::Version
96
109
  version: 0.6.7
97
110
  description: Boostx ables users to create their desire template and it generat new
98
111
  projects based on template
99
112
  email:
100
113
  - arfo.amireza@gmail.com
101
- executables: []
114
+ executables:
115
+ - boostx
102
116
  extensions: []
103
117
  extra_rdoc_files: []
104
118
  files:
105
119
  - README.md
106
- - lib/boostx.rb
107
- - lib/boostx/cli.rb
120
+ - lib/boostx/version.rb
108
121
  - lib/boostx/core/builder.rb
109
- homepage: https://github.com/arfo90/boost
122
+ - lib/boostx/core/template.rb
123
+ - lib/boostx/cli.rb
124
+ - lib/boostx.rb
125
+ - bin/boostx
126
+ homepage: https://github.com/arfo90/boostx
110
127
  licenses:
111
128
  - MIT
112
- metadata: {}
113
129
  post_install_message:
114
130
  rdoc_options: []
115
131
  require_paths:
116
132
  - lib
117
133
  required_ruby_version: !ruby/object:Gem::Requirement
134
+ none: false
118
135
  requirements:
119
- - - ">="
136
+ - - ! '>='
120
137
  - !ruby/object:Gem::Version
121
138
  version: '0'
122
139
  required_rubygems_version: !ruby/object:Gem::Requirement
140
+ none: false
123
141
  requirements:
124
- - - ">="
142
+ - - ! '>='
125
143
  - !ruby/object:Gem::Version
126
144
  version: '0'
127
145
  requirements: []
128
146
  rubyforge_project:
129
- rubygems_version: 2.2.2
147
+ rubygems_version: 1.8.23
130
148
  signing_key:
131
- specification_version: 4
149
+ specification_version: 3
132
150
  summary: Boostx is ruby project template generator.
133
151
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 26f14186dec4aa8d9dae8f520d5dccf562bd892e
4
- data.tar.gz: 76dd9e52a6bcc2ff8e21647c10d11bc74374a648
5
- SHA512:
6
- metadata.gz: 58db8e9d4c95fc14ef93c3144f89c1eea19b6517df90807f64f0af3fe5c284e0feaf693953f8c828ed16ad101e97239fbcdaffb147030fa0cebb12bb0fdd3ddd
7
- data.tar.gz: c78a0b0f8565286a7b656a1701373a25ff2260ecba8a350405924dafc6781442a5d93930783aa6066709b41f6cbe6ad574d2aab56ec0a0b106bc3a0da408e3f2