pyonnuka 0.1.3 → 0.1.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da58c868167a9424713b29a2d2e10eb328d14638
4
- data.tar.gz: e14e7432186bdd7d1ad240f9727db80c1cad0301
3
+ metadata.gz: 82a925dc910ffd19603cc86fd54c8e5f0fb67820
4
+ data.tar.gz: aab968267b89b23522844dc3fa41c8bdd7a328a9
5
5
  SHA512:
6
- metadata.gz: a8fcac64e8a9aaef6efabf041f980995b8e61731b853624362e1ccbc61c7eed7c25367248c3ddeefcf7b7519c4c7ef910d3aba09894b5519d9abef930cf44b67
7
- data.tar.gz: 584a2f04c94324fc5d1a414084cbfc6ef777b18925a36201e6f23b9f375497fb0d3bf76feeab93612a0b5da2345159e3e22f5a7f994cd042eea2bfaaa3760628
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/helpers/commands'
4
+ require 'pyonnuka/commands/command_task'
5
5
 
6
- case ARGV[0]
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
- module Commands
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
- env["PATH_INFO"]
26
- [ 200,
27
- { 'Content-Type' => 'text/plain' },
28
- ["Ruby on Pyonnuka\n\n\n", "Hello, world!!\n", "Path : #{env["PATH_INFO"]}"]
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
@@ -1,3 +1,3 @@
1
1
  module Pyonnuka
2
- VERSION = "0.1.3"
3
- end
2
+ VERSION = "0.1.4"
3
+ end
data/lib/pyonnuka.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'active_support'
2
+ require 'active_support/core_ext'
1
3
  require 'pyonnuka/version'
2
4
  require 'pyonnuka/app/app_generator'
3
5
 
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.3
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