hono 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/Gemfile +3 -0
- data/LICENSE +18 -0
- data/README.md +36 -0
- data/Rakefile +27 -0
- data/bin/hono +3 -0
- data/hono.gemspec +23 -0
- data/lib/hono.rb +4 -0
- data/spec/hono_spec.rb +4 -0
- data/spec/spec_helper.rb +8 -0
- metadata +74 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
Copyright (c) 2010
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
4
|
+
this software and associated documentation files (the "Software"), to deal in
|
5
|
+
the Software without restriction, including without limitation the rights to
|
6
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
7
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
8
|
+
subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
11
|
+
copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
15
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
16
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
17
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
18
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
Hono
|
2
|
+
===========
|
3
|
+
|
4
|
+
A gem template for new projects.
|
5
|
+
|
6
|
+
Requirements
|
7
|
+
------------
|
8
|
+
|
9
|
+
<pre>
|
10
|
+
gem install stencil
|
11
|
+
</pre>
|
12
|
+
|
13
|
+
Setup the template
|
14
|
+
------------------
|
15
|
+
|
16
|
+
You only have to do this once.
|
17
|
+
|
18
|
+
<pre>
|
19
|
+
git clone git@github.com:winton/hono.git
|
20
|
+
cd hono
|
21
|
+
stencil
|
22
|
+
</pre>
|
23
|
+
|
24
|
+
Setup a new project
|
25
|
+
-------------------
|
26
|
+
|
27
|
+
Do this for every new project.
|
28
|
+
|
29
|
+
<pre>
|
30
|
+
mkdir my_project
|
31
|
+
git init
|
32
|
+
stencil hono
|
33
|
+
rake rename
|
34
|
+
</pre>
|
35
|
+
|
36
|
+
The last command does a find-replace (gem\_template -> my\_project) on files and filenames.
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
|
3
|
+
# DELETE AFTER USING
|
4
|
+
desc "Rename project"
|
5
|
+
task :rename do
|
6
|
+
name = ENV['NAME'] || File.basename(Dir.pwd)
|
7
|
+
camelize = lambda do |str|
|
8
|
+
str.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
|
9
|
+
end
|
10
|
+
dir = Dir['**/hono*']
|
11
|
+
begin
|
12
|
+
from = dir.pop
|
13
|
+
if from
|
14
|
+
to = from.split('/')
|
15
|
+
to[-1].gsub!('hono', name)
|
16
|
+
FileUtils.mv(from, to.join('/'))
|
17
|
+
end
|
18
|
+
end while dir.length > 0
|
19
|
+
Dir["**/*"].each do |path|
|
20
|
+
if File.file?(path)
|
21
|
+
`sed -i '' 's/hono/#{name}/g' #{path}`
|
22
|
+
`sed -i '' 's/Hono/#{camelize.call(name)}/g' #{path}`
|
23
|
+
no_space = File.read(path).gsub(/\s+\z/, '')
|
24
|
+
File.open(path, 'w') { |f| f.write(no_space) }
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/bin/hono
ADDED
data/hono.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
root = File.expand_path('../', __FILE__)
|
3
|
+
lib = "#{root}/lib"
|
4
|
+
|
5
|
+
$:.unshift lib unless $:.include?(lib)
|
6
|
+
|
7
|
+
Gem::Specification.new do |s|
|
8
|
+
s.name = "hono"
|
9
|
+
s.version = '0.0.1'
|
10
|
+
s.platform = Gem::Platform::RUBY
|
11
|
+
s.authors = ["Tung Nguyen"]
|
12
|
+
s.email = ["tongueroo@gmail.com"]
|
13
|
+
s.homepage = ""
|
14
|
+
s.summary = %q{}
|
15
|
+
s.description = %q{}
|
16
|
+
|
17
|
+
s.executables = `cd #{root} && git ls-files bin/*`.split("\n").collect { |f| File.basename(f) }
|
18
|
+
s.files = `cd #{root} && git ls-files`.split("\n")
|
19
|
+
s.require_paths = %w(lib)
|
20
|
+
s.test_files = `cd #{root} && git ls-files -- {features,test,spec}/*`.split("\n")
|
21
|
+
|
22
|
+
s.add_development_dependency "rspec", "~> 1.0"
|
23
|
+
end
|
data/lib/hono.rb
ADDED
data/spec/hono_spec.rb
ADDED
data/spec/spec_helper.rb
ADDED
metadata
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: hono
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Tung Nguyen
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-05 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rspec
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.0'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.0'
|
30
|
+
description: ''
|
31
|
+
email:
|
32
|
+
- tongueroo@gmail.com
|
33
|
+
executables:
|
34
|
+
- hono
|
35
|
+
extensions: []
|
36
|
+
extra_rdoc_files: []
|
37
|
+
files:
|
38
|
+
- .gitignore
|
39
|
+
- Gemfile
|
40
|
+
- LICENSE
|
41
|
+
- README.md
|
42
|
+
- Rakefile
|
43
|
+
- bin/hono
|
44
|
+
- hono.gemspec
|
45
|
+
- lib/hono.rb
|
46
|
+
- spec/hono_spec.rb
|
47
|
+
- spec/spec_helper.rb
|
48
|
+
homepage: ''
|
49
|
+
licenses: []
|
50
|
+
post_install_message:
|
51
|
+
rdoc_options: []
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
none: false
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
requirements: []
|
67
|
+
rubyforge_project:
|
68
|
+
rubygems_version: 1.8.24
|
69
|
+
signing_key:
|
70
|
+
specification_version: 3
|
71
|
+
summary: ''
|
72
|
+
test_files:
|
73
|
+
- spec/hono_spec.rb
|
74
|
+
- spec/spec_helper.rb
|