zashoku 1.3.1 → 1.3.2

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: df18c36c1e1c2cf7d9d3ed0daa9868be89e277de
4
- data.tar.gz: 6fdfaa9bea82ba110cac7b33a20bf707d784c2c4
3
+ metadata.gz: 293949927ade60de5f383df77ee37dec6c24dab1
4
+ data.tar.gz: eda30013219a99aa1045aec09f90d326b674c517
5
5
  SHA512:
6
- metadata.gz: 2edcde224a421bac40c1c8e7da236155e92faacc44d205c06595d6e4d9521e52ceb2617925aff443e3583e4f45782007eb0b6b0e2b7cbbec2f3e39691d2c1467
7
- data.tar.gz: 2cccef2b88c666db11242c4b4eea16341571616f3dc7ae066c353f8213889b5ad6f22ae30d46dcff0b7227ff993b1e78cfc4ebe76897bf9f81074ae3b4fe1e4c
6
+ metadata.gz: 4be47481a6d80651cb4534152e34515c3c31e69e20d194257080524dd13d53a24c845236c48a6892a113c63a4d73e9f292feedc00d05338fc94828ede23ba54c
7
+ data.tar.gz: b16bfe03e5cfedf4f9cb4205565eedf821f90d5c7889773ea806afe8ab21aebecd2166ee96c3bcbee44cf3956b136e1d06304d19880e77823b0eac821d6bc56d
data/README.md CHANGED
@@ -1,5 +1,15 @@
1
- # zashoku座食
1
+ [m]: https://codeclimate.com/github/zashoku/zashoku/maintainability
2
+ [mb]: https://api.codeclimate.com/v1/badges/d0b79e115826f30cdc9e/maintainability
3
+
4
+ [g]: https://rubygems.org/gems/zashoku
5
+ [gb]: https://img.shields.io/gem/v/zashoku.svg
6
+
7
+ [c]: https://img.shields.io/badge/ざ-しょく-red.svg
8
+
9
+
10
+ # zashoku座食 [![Maintainability][mb]][m] [![Gem Version][gb]][g] ![座食][c]
2
11
  command line application framework
12
+ ![screenshot](img/screenshot.png)
3
13
 
4
14
  ## features
5
15
  + good for lazy people
@@ -9,17 +19,18 @@ command line application framework
9
19
  + client / server model
10
20
  + rendering support for asian characters
11
21
 
12
- ## examples
22
+ ## tutorial
13
23
  #### create new app
14
24
  `zashoku -g app <name>`
15
25
 
16
26
  #### create new module
17
27
  `zashoku -g module <name>`
18
28
 
29
+ ## example app
30
+ [hello](examples/hello)
19
31
 
20
32
  ## installation
21
33
  `gem install zashoku`
22
34
 
23
35
  ## resources
24
- + [rubydoc.info/gems/zashoku](http://www.rubydoc.info/gems/zashoku/)
25
- + [rubygems.org/gems/zashoku](https://www.rubygems.org/gems/zashoku)
36
+ + [rubydoc.info](http://www.rubydoc.info/gems/zashoku/)
@@ -20,7 +20,7 @@ module Zashoku
20
20
  end
21
21
 
22
22
  def merge!(this, that)
23
- this&.merge(that) do |_k, old, nu|
23
+ this&.merge(that || {}) do |_k, old, nu|
24
24
  old.class == Hash ? merge!(old, nu) : nu
25
25
  end
26
26
  end
@@ -7,7 +7,7 @@ module Zashoku
7
7
  @attributes = attributes
8
8
  keys = []
9
9
  @attr = attributes.map { |k, v|
10
- pk = k.chars.map { |c| [c, c.swapcase] }.flatten
10
+ pk = k.to_s.chars.map { |c| [c, c.swapcase] }.flatten
11
11
  kc = 0
12
12
  kc += 1 while kc < pk.length && keys.include?(pk[kc])
13
13
  keys << pk[kc]
@@ -21,7 +21,12 @@ module Zashoku
21
21
  Zashoku.logger.debug("command got #{message}")
22
22
  message = message.keys.map(&:to_sym).zip(message.values).to_h
23
23
 
24
- obj = controllers[message[:mod]].send(message[:meth], *message[:args])
24
+ obj =
25
+ if controllers.key?(message[:mod]) && controllers[message[:mod]].respond_to?(message[:meth])
26
+ controllers[message[:mod]].send(message[:meth], *message[:args])
27
+ else
28
+ nil
29
+ end
25
30
  Zashoku::Util.encode_object(obj)
26
31
  end
27
32
  end
@@ -3,7 +3,7 @@
3
3
  require_relative 'core/options'
4
4
 
5
5
  module Zashoku
6
- Version = [1, 3, 1].freeze
6
+ Version = [1, 3, 2].freeze
7
7
  Root = File.expand_path('../', __dir__)
8
8
 
9
9
  AppRoot = Root unless const_defined?(:AppRoot)
@@ -11,7 +11,7 @@ module Zashoku
11
11
  ViewerModules = [] unless const_defined?(:ViewerModules)
12
12
  DaemonModules = [] unless const_defined?(:DaemonModules)
13
13
  Host = 'localhost' unless const_defined?(:Host)
14
- Port = 12_345 unless const_defined?(:Port)
14
+ Port = 26_119 unless const_defined?(:Port)
15
15
 
16
16
  LoadPaths = [
17
17
  File.join(Zashoku::AppRoot, 'modules')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zashoku
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - annacrombie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-17 00:00:00.000000000 Z
11
+ date: 2017-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curses