faceter 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/faceter.gemspec +1 -1
- data/lib/faceter/nodes/change_prefix.rb +1 -1
- data/lib/faceter/nodes/create.rb +1 -1
- data/lib/faceter/nodes/exclude.rb +1 -1
- data/lib/faceter/nodes/field.rb +1 -1
- data/lib/faceter/nodes/fold.rb +1 -1
- data/lib/faceter/nodes/group.rb +1 -1
- data/lib/faceter/nodes/list.rb +1 -1
- data/lib/faceter/nodes/rename.rb +1 -1
- data/lib/faceter/nodes/stringify_keys.rb +1 -1
- data/lib/faceter/nodes/symbolize_keys.rb +1 -1
- data/lib/faceter/nodes/unfold.rb +1 -1
- data/lib/faceter/nodes/ungroup.rb +1 -1
- data/lib/faceter/nodes/unwrap.rb +1 -1
- data/lib/faceter/nodes/wrap.rb +1 -1
- data/lib/faceter/rules/append_nested.rb +1 -1
- data/lib/faceter/rules/merge_branches.rb +2 -2
- data/lib/faceter/rules/merge_excludes.rb +1 -1
- data/lib/faceter/rules/merge_renames.rb +1 -1
- data/lib/faceter/rules/order_fields.rb +1 -1
- data/lib/faceter/rules/prepend_nested.rb +1 -1
- data/lib/faceter/version.rb +1 -1
- data/spec/integration/commands/add_prefix_spec.rb +2 -2
- data/spec/integration/commands/exclude_spec.rb +5 -5
- data/spec/integration/commands/fold_spec.rb +2 -2
- data/spec/integration/commands/group_spec.rb +5 -5
- data/spec/integration/commands/remove_prefix_spec.rb +6 -6
- data/spec/integration/commands/rename_spec.rb +2 -2
- data/spec/integration/commands/stringify_keys_spec.rb +8 -8
- data/spec/integration/commands/symbolize_keys_spec.rb +4 -4
- data/spec/integration/commands/unfold_spec.rb +2 -2
- data/spec/integration/commands/ungroup_spec.rb +5 -5
- data/spec/integration/commands/unwrap_spec.rb +4 -4
- data/spec/integration/commands/wrap_spec.rb +4 -4
- data/spec/unit/functions/add_prefix_spec.rb +1 -1
- data/spec/unit/functions/claster_spec.rb +1 -1
- data/spec/unit/functions/drop_prefix_spec.rb +3 -3
- data/spec/unit/functions/group_spec.rb +6 -6
- data/spec/unit/functions/ungroup_spec.rb +1 -1
- data/spec/unit/functions/wrap_spec.rb +6 -6
- data/spec/unit/nodes/add_prefix_spec.rb +7 -7
- data/spec/unit/nodes/create_spec.rb +6 -6
- data/spec/unit/nodes/exclude_spec.rb +1 -1
- data/spec/unit/nodes/field_spec.rb +3 -3
- data/spec/unit/nodes/fold_spec.rb +2 -2
- data/spec/unit/nodes/group_spec.rb +10 -10
- data/spec/unit/nodes/list_spec.rb +2 -2
- data/spec/unit/nodes/remove_prefix_spec.rb +7 -7
- data/spec/unit/nodes/rename_spec.rb +1 -1
- data/spec/unit/nodes/unfold_spec.rb +2 -2
- data/spec/unit/nodes/ungroup_spec.rb +1 -1
- data/spec/unit/nodes/unwrap_spec.rb +4 -4
- data/spec/unit/nodes/wrap_spec.rb +2 -2
- data/spec/unit/rules/append_nested_spec.rb +5 -5
- data/spec/unit/rules/merge_branches_spec.rb +11 -11
- data/spec/unit/rules/merge_excludes_spec.rb +2 -2
- data/spec/unit/rules/merge_renames_spec.rb +7 -7
- data/spec/unit/rules/prepend_nested_spec.rb +5 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2cf266f7b49a3638d144a76f51ddad60c64af90
|
4
|
+
data.tar.gz: e717c2f6d00f63ad0aaaf0acef9c07388cb96766
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 501a24e65b48f6364e9efbf946638bba3c6b9d48a7ecc6c87ada53f1e66718d259203357252a36d9f120fb3eebf541d8ca40589ce7f378225c2683385ca05da5
|
7
|
+
data.tar.gz: 2e92c28f7149f0da7435483da77854a45ddf4b71e303448bc33987b2a2b9d4fd7c1d05607d4e844967c507413dded1c49ca6265ec19067cd85ebd806ea654be5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
## version 0.1.0 2015-09-18
|
2
|
+
|
3
|
+
### Change
|
4
|
+
|
5
|
+
* Switched to 'abstract_mapper' API v0.1.0 (nepalez)
|
6
|
+
with reference to #2 (martinciu)
|
7
|
+
|
8
|
+
[Compare v0.0.2...v0.1.0](https://github.com/nepalez/faceter/compare/v0.0.2...v0.1.0)
|
9
|
+
|
1
10
|
## version 0.0.2 2015-09-18
|
2
11
|
|
3
12
|
### Bugs Fixed
|
data/faceter.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |gem|
|
|
18
18
|
|
19
19
|
gem.required_ruby_version = ">= 2.1"
|
20
20
|
|
21
|
-
gem.add_runtime_dependency "abstract_mapper", "~> 0.0
|
21
|
+
gem.add_runtime_dependency "abstract_mapper", "~> 0.1.0"
|
22
22
|
gem.add_runtime_dependency "selector", "~> 0.0"
|
23
23
|
|
24
24
|
gem.add_development_dependency "hexx-rspec", "~> 0.4"
|
data/lib/faceter/nodes/create.rb
CHANGED
data/lib/faceter/nodes/field.rb
CHANGED
data/lib/faceter/nodes/fold.rb
CHANGED
data/lib/faceter/nodes/group.rb
CHANGED
data/lib/faceter/nodes/list.rb
CHANGED
data/lib/faceter/nodes/rename.rb
CHANGED
data/lib/faceter/nodes/unfold.rb
CHANGED
data/lib/faceter/nodes/unwrap.rb
CHANGED
data/lib/faceter/nodes/wrap.rb
CHANGED
@@ -10,11 +10,11 @@ module Faceter
|
|
10
10
|
#
|
11
11
|
# @api private
|
12
12
|
#
|
13
|
-
class MergeBranches < AbstractMapper::
|
13
|
+
class MergeBranches < AbstractMapper::Rules::Pair
|
14
14
|
|
15
15
|
# @private
|
16
16
|
def optimize?
|
17
|
-
left.is_a?(AbstractMapper::Branch) &&
|
17
|
+
left.is_a?(AbstractMapper::AST::Branch) &&
|
18
18
|
right.class.equal?(__left_node__) &&
|
19
19
|
right.attributes.eql?(__left_attributes__)
|
20
20
|
end
|
data/lib/faceter/version.rb
CHANGED
@@ -9,7 +9,7 @@ describe "add_prefix" do
|
|
9
9
|
{
|
10
10
|
"id" => 1, "name" => "joe",
|
11
11
|
"contacts" => [{ "email" => "joe@example.com" }]
|
12
|
-
|
12
|
+
}
|
13
13
|
]
|
14
14
|
end
|
15
15
|
|
@@ -18,7 +18,7 @@ describe "add_prefix" do
|
|
18
18
|
{
|
19
19
|
"id" => 1, "user-name" => "joe",
|
20
20
|
"user-contacts" => [{ "user-email" => "joe@example.com" }]
|
21
|
-
|
21
|
+
}
|
22
22
|
]
|
23
23
|
end
|
24
24
|
|
@@ -11,23 +11,23 @@ describe "exclude" do
|
|
11
11
|
id: 1,
|
12
12
|
name: "joe",
|
13
13
|
contacts: [{ email: "joe@doe.com", type: "job" }]
|
14
|
-
|
14
|
+
},
|
15
15
|
role: "admin"
|
16
|
-
|
16
|
+
},
|
17
17
|
{
|
18
18
|
user: {
|
19
19
|
id: 2,
|
20
20
|
name: "jane",
|
21
21
|
contacts: [{ email: "jane@doe.com", type: "job" }]
|
22
|
-
|
22
|
+
},
|
23
23
|
role: "admin"
|
24
|
-
|
24
|
+
}
|
25
25
|
]
|
26
26
|
end
|
27
27
|
|
28
28
|
let(:output) do
|
29
29
|
[
|
30
|
-
{ user: { name: "joe", contacts: [{ email: "joe@doe.com" }]
|
30
|
+
{ user: { name: "joe", contacts: [{ email: "joe@doe.com" }] } },
|
31
31
|
{ user: { name: "jane", contacts: [{ email: "jane@doe.com" }] } }
|
32
32
|
]
|
33
33
|
end
|
@@ -11,13 +11,13 @@ describe "group" do
|
|
11
11
|
role: "admin",
|
12
12
|
type: "job",
|
13
13
|
contacts: [{ email: "joe@doe.com" }, { email: "joe@doe.org" }]
|
14
|
-
|
14
|
+
},
|
15
15
|
{
|
16
16
|
name: "Ian",
|
17
17
|
role: "admin",
|
18
18
|
type: "job",
|
19
19
|
contacts: [{ email: "ian@doe.com" }, { email: "ian@doe.org" }]
|
20
|
-
|
20
|
+
}
|
21
21
|
]
|
22
22
|
end
|
23
23
|
|
@@ -32,16 +32,16 @@ describe "group" do
|
|
32
32
|
{ email: "joe@doe.com", type: "job" },
|
33
33
|
{ email: "joe@doe.org", type: "job" }
|
34
34
|
]
|
35
|
-
|
35
|
+
},
|
36
36
|
{
|
37
37
|
name: "Ian",
|
38
38
|
contacts: [
|
39
39
|
{ email: "ian@doe.com", type: "job" },
|
40
40
|
{ email: "ian@doe.org", type: "job" }
|
41
41
|
]
|
42
|
-
|
42
|
+
}
|
43
43
|
]
|
44
|
-
|
44
|
+
}
|
45
45
|
]
|
46
46
|
end
|
47
47
|
|
@@ -15,12 +15,12 @@ describe "remove_prefix" do
|
|
15
15
|
{
|
16
16
|
:"contact.address" => "joe@doe.com",
|
17
17
|
"contact.type" => "job"
|
18
|
-
|
18
|
+
}
|
19
19
|
],
|
20
20
|
user_skype: "joe"
|
21
|
-
|
21
|
+
}
|
22
22
|
]
|
23
|
-
|
23
|
+
}
|
24
24
|
]
|
25
25
|
end
|
26
26
|
|
@@ -35,12 +35,12 @@ describe "remove_prefix" do
|
|
35
35
|
{
|
36
36
|
address: "joe@doe.com",
|
37
37
|
"type" => "job"
|
38
|
-
|
38
|
+
}
|
39
39
|
],
|
40
40
|
user_skype: "joe"
|
41
|
-
|
41
|
+
}
|
42
42
|
]
|
43
|
-
|
43
|
+
}
|
44
44
|
]
|
45
45
|
end
|
46
46
|
|
@@ -6,14 +6,14 @@ describe "rename" do
|
|
6
6
|
|
7
7
|
let(:input) do
|
8
8
|
[
|
9
|
-
{ user: { name: "joe", contacts: [{ email: "joe@doe.com" }]
|
9
|
+
{ user: { name: "joe", contacts: [{ email: "joe@doe.com" }] } },
|
10
10
|
{ user: { name: "jane", contacts: [{ email: "jane@doe.com" }] } }
|
11
11
|
]
|
12
12
|
end
|
13
13
|
|
14
14
|
let(:output) do
|
15
15
|
[
|
16
|
-
{ "user" => { "name" => "joe", emails: [{ address: "joe@doe.com" }]
|
16
|
+
{ "user" => { "name" => "joe", emails: [{ address: "joe@doe.com" }] } },
|
17
17
|
{ "user" => { "name" => "jane", emails: [{ address: "jane@doe.com" }] } }
|
18
18
|
]
|
19
19
|
end
|
@@ -11,17 +11,17 @@ describe "stringify_keys" do
|
|
11
11
|
user: {
|
12
12
|
name: "joe",
|
13
13
|
"emails" => [{ address: "joe@doe.com" }]
|
14
|
-
|
14
|
+
},
|
15
15
|
roles: [{ name: "admin" }]
|
16
|
-
|
16
|
+
},
|
17
17
|
{
|
18
18
|
id: 2,
|
19
19
|
user: {
|
20
20
|
name: "jane",
|
21
21
|
"emails" => [{ address: "jane@doe.com" }]
|
22
|
-
|
22
|
+
},
|
23
23
|
roles: [{ name: "admin" }]
|
24
|
-
|
24
|
+
}
|
25
25
|
]
|
26
26
|
end
|
27
27
|
|
@@ -32,17 +32,17 @@ describe "stringify_keys" do
|
|
32
32
|
"user" => {
|
33
33
|
"name" => "joe",
|
34
34
|
"emails" => [{ "address" => "joe@doe.com" }]
|
35
|
-
|
35
|
+
},
|
36
36
|
"roles" => [{ name: "admin" }]
|
37
|
-
|
37
|
+
},
|
38
38
|
{
|
39
39
|
"id" => 2,
|
40
40
|
"user" => {
|
41
41
|
"name" => "jane",
|
42
42
|
"emails" => [{ "address" => "jane@doe.com" }]
|
43
|
-
|
43
|
+
},
|
44
44
|
"roles" => [{ name: "admin" }]
|
45
|
-
|
45
|
+
}
|
46
46
|
]
|
47
47
|
end
|
48
48
|
|
@@ -11,9 +11,9 @@ describe "symbolize_keys" do
|
|
11
11
|
"user" => {
|
12
12
|
"name" => "joe",
|
13
13
|
emails: [{ "address" => "joe@doe.com" }]
|
14
|
-
|
14
|
+
},
|
15
15
|
"roles" => [{ "name" => "admin" }]
|
16
|
-
|
16
|
+
}
|
17
17
|
]
|
18
18
|
end
|
19
19
|
|
@@ -24,9 +24,9 @@ describe "symbolize_keys" do
|
|
24
24
|
user: {
|
25
25
|
name: "joe",
|
26
26
|
emails: [{ address: "joe@doe.com" }]
|
27
|
-
|
27
|
+
},
|
28
28
|
roles: [{ "name" => "admin" }]
|
29
|
-
|
29
|
+
}
|
30
30
|
]
|
31
31
|
end
|
32
32
|
|