pyonnuka 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pyonnuka +2 -14
- data/lib/pyonnuka/commands/command_task.rb +26 -0
- data/lib/pyonnuka/helpers/commands.rb +8 -1
- data/lib/pyonnuka/templates/config/application.rb +6 -5
- data/lib/pyonnuka/version.rb +2 -2
- data/lib/pyonnuka.rb +2 -0
- data/pyonnuka.gemspec +0 -1
- metadata +2 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82a925dc910ffd19603cc86fd54c8e5f0fb67820
|
4
|
+
data.tar.gz: aab968267b89b23522844dc3fa41c8bdd7a328a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0800bfae7b5dbd8f40fb0e964d647957390bdd3e6046df3c1afe98559d477623a2f48093ed8f0f28e918baf77cb826c70cc9738a99d96b755a6a61d0867be5a
|
7
|
+
data.tar.gz: c0f89ba495fc47ee0388d710ee875b797f4dd5f0292ddd712f07776358ad3b7247b4d5747bd8433af161da80c647c04cf3afe64852c1d0bfa62fd006b822d432
|
data/bin/pyonnuka
CHANGED
@@ -1,19 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'pyonnuka'
|
4
|
-
require 'pyonnuka/
|
4
|
+
require 'pyonnuka/commands/command_task'
|
5
5
|
|
6
|
-
|
7
|
-
when 'new'
|
8
|
-
raise 'error' if ARGV[1].nil?
|
9
|
-
app_name = ARGV[1]
|
10
|
-
generator = Pyonnuka::Generators::AppGenerator.new(app_name)
|
11
|
-
generator.start
|
12
|
-
when '-h'
|
13
|
-
Pyonnuka::Helpers::Commands.out_help
|
14
|
-
when '-v'
|
15
|
-
puts "Pyonnuka #{Pyonnuka::VERSION}"
|
6
|
+
Pyonnuka::Command.discriminate_command(ARGV)
|
16
7
|
|
17
|
-
else
|
18
|
-
Pyonnuka::Helpers::Commands.out_help
|
19
|
-
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'pyonnuka/helpers/commands'
|
2
|
+
|
3
|
+
module Pyonnuka
|
4
|
+
class Command < Pyonnuka::Helpers::Command
|
5
|
+
class << self
|
6
|
+
def discriminate_command(command)
|
7
|
+
if command[0].nil?
|
8
|
+
out_help
|
9
|
+
return
|
10
|
+
end
|
11
|
+
|
12
|
+
case command[0]
|
13
|
+
when 'new'
|
14
|
+
app_path = command[1]
|
15
|
+
return unless validate_app_path(app_path)
|
16
|
+
generator = Pyonnuka::Generators::AppGenerator.new(app_name)
|
17
|
+
generator.start
|
18
|
+
when '-h'
|
19
|
+
out_help
|
20
|
+
when '-v'
|
21
|
+
puts "Pyonnuka #{Pyonnuka::VERSION}"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Pyonnuka
|
2
2
|
module Helpers
|
3
|
-
|
3
|
+
class Command
|
4
4
|
class << self
|
5
5
|
def out_help
|
6
6
|
puts <<"EOS"
|
@@ -14,6 +14,13 @@ Pyonnuka options:
|
|
14
14
|
-v # Show this pyonnuka version
|
15
15
|
EOS
|
16
16
|
end
|
17
|
+
|
18
|
+
def validate_app_path(app_path)
|
19
|
+
return true if app_path.present? && ['Pyonnuka', 'pyonnuka'].exclude?(app_path)
|
20
|
+
|
21
|
+
puts app_path.nil? ? 'required application path' : 'Invalid application name pyonnuka. Please choose another name'
|
22
|
+
false
|
23
|
+
end
|
17
24
|
end
|
18
25
|
end
|
19
26
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'oyonnuka'
|
1
2
|
require 'pathname'
|
2
3
|
require 'active_support'
|
3
4
|
require 'active_support/dependencies/autoload'
|
@@ -22,11 +23,11 @@ end
|
|
22
23
|
module <%= @app_name %>
|
23
24
|
class Application < Pyonnuka::Application
|
24
25
|
def call(env)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
26
|
+
env["PATH_INFO"]
|
27
|
+
[ 200,
|
28
|
+
{ 'Content-Type' => 'text/plain' },
|
29
|
+
["Ruby on Pyonnuka\n\n\n", "Hello, world!!\n", "Path : #{env["PATH_INFO"]}"]
|
30
|
+
]
|
30
31
|
end
|
31
32
|
end
|
32
33
|
end
|
data/lib/pyonnuka/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Pyonnuka
|
2
|
-
VERSION = "0.1.
|
3
|
-
end
|
2
|
+
VERSION = "0.1.4"
|
3
|
+
end
|
data/lib/pyonnuka.rb
CHANGED
data/pyonnuka.gemspec
CHANGED
@@ -23,6 +23,5 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency "rake", "~> 10.0"
|
24
24
|
spec.add_development_dependency "rspec"
|
25
25
|
spec.add_development_dependency "activesupport"
|
26
|
-
spec.add_development_dependency "activerecord"
|
27
26
|
spec.add_development_dependency "slim"
|
28
27
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pyonnuka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- masaki_nukaga
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: activerecord
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: slim
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -117,6 +103,7 @@ files:
|
|
117
103
|
- bin/setup
|
118
104
|
- lib/pyonnuka.rb
|
119
105
|
- lib/pyonnuka/app/app_generator.rb
|
106
|
+
- lib/pyonnuka/commands/command_task.rb
|
120
107
|
- lib/pyonnuka/helpers/commands.rb
|
121
108
|
- lib/pyonnuka/templates/Gemfile
|
122
109
|
- lib/pyonnuka/templates/app/views/welcome/index.html.slim
|