cear 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1af13bf5e34cce4e32cc71334f97c02fc428f093
4
- data.tar.gz: 3c1057f65d778b315d11bc455125fd40113cc76e
3
+ metadata.gz: 3873e599771ac99beb98c3fc0303aa51f02303d6
4
+ data.tar.gz: 25c186a591ec9b8a954ace3dac7eeef4768f1284
5
5
  SHA512:
6
- metadata.gz: 68f3f32d3d5ec8d98b3b6e77661f30c315c76186f5fd91cd349234c09b7250e3e4990987639ad4859ad38bd051bfbc00e52b72b369a21e255fb1bf3206e8eb50
7
- data.tar.gz: df426ffaecb3506c062c103ed3f6931d305c40e2ca45e8f606bd5a39cb231a4ef51acda88ee655df8531f3ec657eed25dddb3b0acf92350c85e7e7661f29a89e
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
@@ -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("../../template/#{file}", __FILE__))
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("../../template/#{file}", __FILE__)).read + '"', binding, __FILE__, __LINE__)
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
- file.write(file_generator('header') + "\n") if options[:header]
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
@@ -1,3 +1,3 @@
1
1
  module Cear
2
- VERSION = "0.1.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -1,3 +1,5 @@
1
+ #encoding: utf-8
2
+
1
3
  Encoding.default_external = Encoding::UTF_8
2
4
  Encoding.default_internal = Encoding::UTF_8
3
5
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  ##
4
4
  ## #{@filename}
5
- ## Gaetan JUVIN #{Time.now.to_date.strftime('%d/%m/%Y')}
5
+ ## #{Time.now.to_date.strftime('%d/%m/%Y')}
6
6
  ##
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.1.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-07-15 00:00:00.000000000 Z
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.4.5
159
+ rubygems_version: 2.2.2
163
160
  signing_key:
164
161
  specification_version: 4
165
162
  summary: Ruby project generator.
@@ -1,2 +0,0 @@
1
- 2.2.1
2
-
@@ -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
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here