munge 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/munge/cli/commands/update.rb +1 -1
- data/lib/munge/cli/dispatch.rb +3 -0
- data/lib/munge/errors.rb +77 -0
- data/lib/munge/init.rb +3 -3
- data/lib/munge/runner.rb +1 -1
- data/lib/munge/system/collection.rb +2 -2
- data/lib/munge/system/processor.rb +2 -2
- data/lib/munge/system/router.rb +2 -2
- data/lib/munge/util/config.rb +2 -0
- data/lib/munge/version.rb +1 -1
- data/lib/munge.rb +1 -0
- data/seeds/{config → lib}/_asset_roots.rb +0 -0
- data/seeds/{config → lib}/routing.rb +0 -0
- data/seeds/{config → lib}/sass.rb +0 -0
- data/seeds/{config → lib}/view_helpers.rb +0 -0
- data/seeds/setup.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0a3b52e10d621eb9279d8e67047237914533a18
|
4
|
+
data.tar.gz: 772664c0d20c42a8ebc98bf158cef506429b73cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 146e9511c1b41e8326657a16e20993fc44506d35b784194e8c182a2c60d0f1744a7ea85a222320ed28eb038b99e8ef9093996f7860058c377815fdeeaf7a2439
|
7
|
+
data.tar.gz: 77d5320774df65fd79e61dc417f2a9a4c7fd3856da5654b7055553d56d9607bbd93f3d98b9b83bd1981d178bb4330235a1f2ae3bcd75554ab6d43843a809f161
|
data/lib/munge/cli/dispatch.rb
CHANGED
data/lib/munge/errors.rb
ADDED
@@ -0,0 +1,77 @@
|
|
1
|
+
module Munge
|
2
|
+
module Errors
|
3
|
+
class Base < StandardError
|
4
|
+
end
|
5
|
+
|
6
|
+
module ErrorWithIdentifier
|
7
|
+
def initialize(identifier)
|
8
|
+
@identifier = identifier
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class DoubleWriteError < Base
|
13
|
+
include ErrorWithIdentifier
|
14
|
+
|
15
|
+
def message
|
16
|
+
"attempted to write #{@identifier} twice"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
class DuplicateItemError < Base
|
21
|
+
include ErrorWithIdentifier
|
22
|
+
|
23
|
+
def message
|
24
|
+
"item with id `#{@identifier}` already exists"
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class ItemNotFoundError < Base
|
29
|
+
include ErrorWithIdentifier
|
30
|
+
|
31
|
+
def message
|
32
|
+
"item not found (#{@identifier})"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
class ItemHasNoRouteError < Base
|
37
|
+
include ErrorWithIdentifier
|
38
|
+
|
39
|
+
def message
|
40
|
+
"item `#{@identifier}` has no route"
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class DuplicateTransformerError < Base
|
45
|
+
include ErrorWithIdentifier
|
46
|
+
|
47
|
+
def message
|
48
|
+
"already registered transformer `#{@identifier}`"
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
class TransformerNotFoundError < Base
|
53
|
+
include ErrorWithIdentifier
|
54
|
+
|
55
|
+
def message
|
56
|
+
"transformer `#{@identifier}` is not installed"
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
class InvalidRouterError < Base
|
61
|
+
include ErrorWithIdentifier
|
62
|
+
|
63
|
+
def message
|
64
|
+
"invalid router with type #{@identifier}"
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
class ConfigYmlNotFound < Base
|
69
|
+
include ErrorWithIdentifier
|
70
|
+
|
71
|
+
def message
|
72
|
+
"Expected to find config file: #{@identifier}\n" \
|
73
|
+
"Are you in the correct directory, or did you run `munge init`?"
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/lib/munge/init.rb
CHANGED
@@ -24,9 +24,9 @@ module Munge
|
|
24
24
|
@app.items.freeze
|
25
25
|
end
|
26
26
|
|
27
|
-
# @return [String] path to user's `
|
28
|
-
def
|
29
|
-
File.join(root_path, "
|
27
|
+
# @return [String] path to user's `lib/` directory
|
28
|
+
def lib_path
|
29
|
+
File.join(root_path, "lib")
|
30
30
|
end
|
31
31
|
|
32
32
|
# Loads file into current scope. Similar to `load "filename.rb"`
|
data/lib/munge/runner.rb
CHANGED
@@ -48,7 +48,7 @@ module Munge
|
|
48
48
|
# @return [void]
|
49
49
|
def push(item)
|
50
50
|
if @items.key?(item.id)
|
51
|
-
raise
|
51
|
+
raise Errors::DuplicateItemError, item.id
|
52
52
|
else
|
53
53
|
@items[item.id] = item
|
54
54
|
end
|
@@ -60,7 +60,7 @@ module Munge
|
|
60
60
|
if @items.key?(id)
|
61
61
|
@items[id]
|
62
62
|
else
|
63
|
-
raise
|
63
|
+
raise Errors::ItemNotFoundError, id
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -19,7 +19,7 @@ module Munge
|
|
19
19
|
# @param transformer [#call]
|
20
20
|
def register_manually(name, transformer)
|
21
21
|
if @registry.key?(name)
|
22
|
-
raise
|
22
|
+
raise Errors::DuplicateTransformerError, name
|
23
23
|
else
|
24
24
|
@registry[name] = transformer
|
25
25
|
end
|
@@ -44,7 +44,7 @@ module Munge
|
|
44
44
|
if @registry.key?(name)
|
45
45
|
@registry[name]
|
46
46
|
else
|
47
|
-
raise
|
47
|
+
raise Errors::TransformerNotFoundError, name
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
data/lib/munge/system/router.rb
CHANGED
@@ -13,7 +13,7 @@ module Munge
|
|
13
13
|
when :filepath
|
14
14
|
@registries[:filepath].push(router)
|
15
15
|
else
|
16
|
-
raise
|
16
|
+
raise Errors::InvalidRouterError, router.type
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
@@ -32,7 +32,7 @@ module Munge
|
|
32
32
|
|
33
33
|
def route_mapper(item, method_name, initial_route = nil)
|
34
34
|
if !item.route && !initial_route
|
35
|
-
raise
|
35
|
+
raise Errors::ItemHasNoRouteError, item.relpath
|
36
36
|
end
|
37
37
|
|
38
38
|
itemish = Itemish.new(item, @processor)
|
data/lib/munge/util/config.rb
CHANGED
data/lib/munge/version.rb
CHANGED
data/lib/munge.rb
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/seeds/setup.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: munge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zach Ahn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -308,7 +308,7 @@ dependencies:
|
|
308
308
|
- - "<"
|
309
309
|
- !ruby/object:Gem::Version
|
310
310
|
version: '2.0'
|
311
|
-
description: Documentation for this release is located in https://github.com/zachahn/munge/blob/v0.
|
311
|
+
description: Documentation for this release is located in https://github.com/zachahn/munge/blob/v0.13.0/README.md
|
312
312
|
email:
|
313
313
|
- zach.ahn@gmail.com
|
314
314
|
executables:
|
@@ -330,6 +330,7 @@ files:
|
|
330
330
|
- lib/munge/cli/commands/update.rb
|
331
331
|
- lib/munge/cli/commands/view.rb
|
332
332
|
- lib/munge/cli/dispatch.rb
|
333
|
+
- lib/munge/errors.rb
|
333
334
|
- lib/munge/formatters/default.rb
|
334
335
|
- lib/munge/formatters/dots.rb
|
335
336
|
- lib/munge/go/sass.rb
|
@@ -371,13 +372,13 @@ files:
|
|
371
372
|
- seeds/.gitignore
|
372
373
|
- seeds/Gemfile.tt
|
373
374
|
- seeds/config.yml
|
374
|
-
- seeds/config/_asset_roots.rb
|
375
|
-
- seeds/config/routing.rb
|
376
|
-
- seeds/config/sass.rb
|
377
|
-
- seeds/config/view_helpers.rb
|
378
375
|
- seeds/data.yml
|
379
376
|
- seeds/layouts/default.html.erb
|
380
377
|
- seeds/layouts/sitemap.html.erb
|
378
|
+
- seeds/lib/_asset_roots.rb
|
379
|
+
- seeds/lib/routing.rb
|
380
|
+
- seeds/lib/sass.rb
|
381
|
+
- seeds/lib/view_helpers.rb
|
381
382
|
- seeds/rules.rb
|
382
383
|
- seeds/setup.rb
|
383
384
|
- seeds/src/about.html.erb
|