cear 0.1.0 → 0.3.0
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/README.md +22 -0
- data/lib/cear/file.rb +11 -5
- data/lib/cear/version.rb +1 -1
- data/lib/template/environment.rb +2 -0
- data/lib/template/header +1 -1
- metadata +3 -6
- data/.ruby-version +0 -2
- data/bin/console +0 -14
- data/bin/setup +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3873e599771ac99beb98c3fc0303aa51f02303d6
|
4
|
+
data.tar.gz: 25c186a591ec9b8a954ace3dac7eeef4768f1284
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a631009957860395c8073e7f3bd84da81b782f675a97d296e485136d801cc4e0c81d1d47c0da80971d0fd16769d5aee51f3fa862b53de11c104b0c0f447e05a
|
7
|
+
data.tar.gz: 597acf9680710a4802871d27a4cda8a8c3bc704da9913274628edefb842b64c600654885ca1df9acc585bbc301e994906f4d605a6311940c68558ff1781283e8
|
data/README.md
CHANGED
@@ -20,6 +20,28 @@ new_project
|
|
20
20
|
new_project.rb
|
21
21
|
```
|
22
22
|
|
23
|
+
Installation
|
24
|
+
------------
|
25
|
+
|
26
|
+
Installation is fairly simple, I host mail on rubygems, so you can just do:
|
27
|
+
|
28
|
+
```
|
29
|
+
# gem install cear
|
30
|
+
```
|
31
|
+
|
32
|
+
Configuration
|
33
|
+
-------
|
34
|
+
```
|
35
|
+
$>cat ~/.cear_header
|
36
|
+
#encoding: utf-8
|
37
|
+
|
38
|
+
##
|
39
|
+
## #{@filename}
|
40
|
+
## MyNaMe :-) #{Time.now.to_date.strftime('%d/%m/%Y')}
|
41
|
+
##
|
42
|
+
$>
|
43
|
+
```
|
44
|
+
|
23
45
|
Roadmap
|
24
46
|
-------
|
25
47
|
- Custom template
|
data/lib/cear/file.rb
CHANGED
@@ -24,12 +24,12 @@ module Cear
|
|
24
24
|
condition ? gems.map {|g| "gem '#{g}'"}.join("\n") : ""
|
25
25
|
end
|
26
26
|
|
27
|
-
def template_exists?(file)
|
28
|
-
::File.exists?(::File.expand_path("
|
27
|
+
def template_exists?(file, path = '../../template')
|
28
|
+
::File.exists?(::File.expand_path("#{path}/#{file}", __FILE__))
|
29
29
|
end
|
30
30
|
|
31
|
-
def file_generator(file)
|
32
|
-
eval('"' + ::File.open(::File.expand_path("
|
31
|
+
def file_generator(file, path = '../../template')
|
32
|
+
eval('"' + ::File.open(::File.expand_path("#{path}/#{file}", __FILE__)).read + '"', binding, __FILE__, __LINE__)
|
33
33
|
end
|
34
34
|
|
35
35
|
def generate_file(filename, options = {})
|
@@ -39,7 +39,13 @@ module Cear
|
|
39
39
|
if ::File.exists?(@filename) == false or AskQuestion.new("Replace file #{@filename}?", "n/Y").ask != 'n'
|
40
40
|
puts "Generate #{filename}".green
|
41
41
|
::File.open(@filename, 'w') do |file|
|
42
|
-
|
42
|
+
if options[:header]
|
43
|
+
if template_exists?('.cear_header', ::File.expand_path('~/'))
|
44
|
+
file.write(file_generator('.cear_header', ::File.expand_path('~/')) + "\n")
|
45
|
+
else
|
46
|
+
file.write(file_generator('header') + "\n")
|
47
|
+
end
|
48
|
+
end
|
43
49
|
if template_exists?(@filename)
|
44
50
|
file.write(file_generator(@filename))
|
45
51
|
else
|
data/lib/cear/version.rb
CHANGED
data/lib/template/environment.rb
CHANGED
data/lib/template/header
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cear
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gaëtan JUVIN
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -117,14 +117,11 @@ extensions: []
|
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
119
|
- ".gitignore"
|
120
|
-
- ".ruby-version"
|
121
120
|
- Gemfile
|
122
121
|
- LICENSE.txt
|
123
122
|
- README.md
|
124
123
|
- Rakefile
|
125
124
|
- bin/cear
|
126
|
-
- bin/console
|
127
|
-
- bin/setup
|
128
125
|
- cear.gemspec
|
129
126
|
- lib/cear.rb
|
130
127
|
- lib/cear/ask_question/ask_question.rb
|
@@ -159,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
156
|
version: '0'
|
160
157
|
requirements: []
|
161
158
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.
|
159
|
+
rubygems_version: 2.2.2
|
163
160
|
signing_key:
|
164
161
|
specification_version: 4
|
165
162
|
summary: Ruby project generator.
|
data/.ruby-version
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "cear"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start
|