getto-elm-layout-router 0.0.3

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 5128f98ab8e87d29b5207c47f2daeecaad7c8765
4
+ data.tar.gz: cde39936c4b057e96e98925c1db5be8348163d3f
5
+ SHA512:
6
+ metadata.gz: '0200992a8f05d175136db3521c21f929ea4ec0f83208e8a0ae2f3fb6b95e740ba152b90e6e4f5affc1002c4b79ba49ff6ee5a516ad24f4c209abcfe4e1cc2a28'
7
+ data.tar.gz: cfac3cea049c499d99c3adbd85e791eac6606c6e1808a5ab722b583cf3d7d96874c40ef498e8891de677cf4eec98156f9d9ba0467d3d0350a8d94147cb568b53
data/.envrc ADDED
@@ -0,0 +1,4 @@
1
+ export APP_ROOT=$(pwd)
2
+ export PATH=$APP_ROOT/bin:$PATH
3
+
4
+ export DOCKER_WRAPPER_IMAGE_ruby=2.4.1
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /vendor/
@@ -0,0 +1,13 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.1
5
+ before_install: gem install bundler -v 1.15.4
6
+ deploy:
7
+ provider: rubygems
8
+ api_key:
9
+ secure: muG5PaWqr+z9QpQFinwUwR/3pXXAaWWYb/6L+lRN9aNWmQJxCKAgzJYe437VdGO56N3kYlMgzBqdW/sBr7kK3Ih+IbtyKezbj7iSPOYdaKWB33bk7sWE3G8mHbuxQG0egAOPZs3iwhEn2okdTINLBU3gjbRYgF1NFLwo63A7PG689Krol3GFyGzAwy8iLgcz53Pnx/JdMQ6nA+NPCyFgMYhSIOLQhQSwdRRNf4+JvL2q6nerA00Ujcidnw2k7B6skG+8OGZqebSAQmA+VYCyrSQpTkdY/1UGWK0IX6G/nRcB9ecscGE2p3Qy0vDqusbTl1TEfil+IXeFIB4J0yzI/vkUVwziwbIG67aDZIrn+YrmVHrxX6kDY7lSe089vemdDQJdHlrEgQll97OOl5rstxwnyblu0Wt9gzqi0X/H79K9MCyiKZTPjztZKRyt3V6HgBZk7RNz5eVaTQoqdlbt6lgJmZjSOZSjOcMQxFLHJao7YipRtfUR7sRVPDiO5sowf4gRO5/Y+MakwN039xJZUhY7odpxMmVOJvM6dZ1A2qHGJ/k+cQABQq5TgKIoHFKqOfRkYkH1ML8zFlLhakn9DV0mam0w24tl+QRPoGea87Y5yjpaapZZ8UgD+Bs4hhmjG0ssKgdJDyK2FI5keYsHRXaw4e97I9cOPn2bkR+9rYE=
10
+ gem: getto-elm-layout-router
11
+ on:
12
+ tags: true
13
+ repo: getto-systems/getto-elm-layout-router
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in getto-elm-layout-router.gemspec
6
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 GETTO Systems
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,37 @@
1
+ # Getto::Elm::Layout::Router
2
+
3
+ [![Build Status](https://travis-ci.org/getto-systems/getto-elm-layout-router.svg?branch=master)](https://travis-ci.org/getto-systems/getto-elm-layout-router)
4
+ [![Gem Version](https://badge.fury.io/rb/getto-elm-layout-router.svg)](https://badge.fury.io/rb/getto-elm-layout-router)
5
+
6
+
7
+ router script for getto-elm-layout
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'getto-elm-layout-router'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install getto-elm-layout-router
24
+
25
+ ## Usage
26
+
27
+ TODO: Write usage instructions here
28
+
29
+ ## Development
30
+
31
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
32
+
33
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
34
+
35
+ ## Contributing
36
+
37
+ Bug reports and pull requests are welcome on GitHub at https://github.com/getto-systems/getto-elm-layout-router.
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "getto/elm/layout/router"
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(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "getto/elm/layout/router/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "getto-elm-layout-router"
8
+ spec.version = Getto::Elm::Layout::Router::VERSION
9
+ spec.authors = ["shun"]
10
+ spec.email = ["shun@getto.systems"]
11
+ spec.license = "MIT"
12
+
13
+ spec.summary = %q{router for getto-elm-layout}
14
+ spec.description = %q{create routes.json for getto-elm-layout's router data}
15
+ spec.homepage = "https://github.com/getto-systems/getto-elm-layout-router"
16
+
17
+ # Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
18
+ # to allow pushing to a single host or delete this section to allow pushing to any host.
19
+ if spec.respond_to?(:metadata)
20
+ spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
+ else
22
+ raise "RubyGems 2.0 or newer is required to protect against " \
23
+ "public gem pushes."
24
+ end
25
+
26
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
+ f.match(%r{^(test|spec|features)/})
28
+ end
29
+ spec.bindir = "exe"
30
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
31
+ spec.require_paths = ["lib"]
32
+
33
+ spec.add_development_dependency "bundler", "~> 1.15"
34
+ spec.add_development_dependency "rake", "~> 10.0"
35
+ spec.add_development_dependency "minitest", "~> 5.0"
36
+ spec.add_development_dependency "travis", "~> 1.8"
37
+ end
@@ -0,0 +1,13 @@
1
+ require "getto/elm/layout/router/version"
2
+
3
+ module Getto
4
+ module Elm
5
+ module Layout
6
+ module Router
7
+ autoload :Drawer, "getto/elm/layout/router/drawer"
8
+ autoload :Container, "getto/elm/layout/router/container"
9
+ autoload :HashEx, "getto/elm/layout/router/hash_ex"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,22 @@
1
+ module Getto::Elm::Layout::Router
2
+ class Container < BasicObject
3
+ using HashEx
4
+
5
+ def initialize(path,app)
6
+ @path = path
7
+ @app = app
8
+ @config = {}
9
+ end
10
+
11
+ def namespace(path,&block)
12
+ @config.merge! Container.new(@path.dup.push(path),@app).instance_exec(&block)
13
+ end
14
+ def page(page,title,config={})
15
+ @config.merge!(
16
+ (@path + [page]).join("/") => @app.deep_merge(config).deep_merge(
17
+ title: title,
18
+ )
19
+ )
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,17 @@
1
+ require "json"
2
+
3
+ module Getto::Elm::Layout::Router
4
+ class Drawer
5
+ def initialize(output_file,app={})
6
+ @output_file = output_file
7
+ @app = app
8
+ end
9
+
10
+ def draw(&block)
11
+ File.write @output_file, build(&block)
12
+ end
13
+ def build(&block)
14
+ Container.new([],@app).instance_exec(&block)
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,19 @@
1
+ module Getto::Elm::Layout::Router
2
+ module HashEx
3
+ refine Hash do
4
+ def deep_merge(hash)
5
+ unless hash.respond_to?(:map)
6
+ hash
7
+ else
8
+ merge Hash[hash.map{|k,v|
9
+ case self[k]
10
+ when Hash
11
+ v = self[k].deep_merge(v)
12
+ end
13
+ [k, v]
14
+ }]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,9 @@
1
+ module Getto
2
+ module Elm
3
+ module Layout
4
+ module Router
5
+ VERSION = "0.0.3"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ {"demo/demo1":{"title":"demo1"},"demo/demo2":{"title":"demo2"},"demo/demo3":{"title":"demo3"}}
@@ -0,0 +1,28 @@
1
+ require "getto/elm/layout/router"
2
+
3
+ router = Getto::Elm::Layout::Router::Drawer.new(
4
+ File.expand_path("../routes.json",__FILE__),
5
+ app: {
6
+ port: 1000,
7
+ project: "getto/habit",
8
+ company: "GETTO",
9
+ title: "Habit",
10
+ sub: "logging works",
11
+ },
12
+ version: {
13
+ css: "0.0.3",
14
+ app: "0.0.1",
15
+ },
16
+ package: {
17
+ "page": "GettoHabit",
18
+ "i18n": "GettoHabit",
19
+ },
20
+ )
21
+
22
+ router.draw do
23
+ namespace :demo do
24
+ page :demo1, "demo1"
25
+ page :demo2, "demo2", version: {css: "0.1.4"}
26
+ page :demo3, "demo3", package: {page: "GettoLayout"}
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: getto-elm-layout-router
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ platform: ruby
6
+ authors:
7
+ - shun
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2017-09-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.15'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.15'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: travis
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.8'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.8'
69
+ description: create routes.json for getto-elm-layout's router data
70
+ email:
71
+ - shun@getto.systems
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".envrc"
77
+ - ".gitignore"
78
+ - ".travis.yml"
79
+ - Gemfile
80
+ - LICENSE
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
85
+ - getto-elm-layout-router.gemspec
86
+ - lib/getto/elm/layout/router.rb
87
+ - lib/getto/elm/layout/router/container.rb
88
+ - lib/getto/elm/layout/router/drawer.rb
89
+ - lib/getto/elm/layout/router/hash_ex.rb
90
+ - lib/getto/elm/layout/router/version.rb
91
+ - routes.json
92
+ - routes.rb
93
+ homepage: https://github.com/getto-systems/getto-elm-layout-router
94
+ licenses:
95
+ - MIT
96
+ metadata:
97
+ allowed_push_host: https://rubygems.org
98
+ post_install_message:
99
+ rdoc_options: []
100
+ require_paths:
101
+ - lib
102
+ required_ruby_version: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ - - ">="
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - ">="
110
+ - !ruby/object:Gem::Version
111
+ version: '0'
112
+ requirements: []
113
+ rubyforge_project:
114
+ rubygems_version: 2.6.13
115
+ signing_key:
116
+ specification_version: 4
117
+ summary: router for getto-elm-layout
118
+ test_files: []