yaks-html 0.6.0.alpha → 0.6.0.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -525
- data/Rakefile +1 -41
- data/{yaks-html/lib → lib}/yaks-html.rb +0 -0
- data/{yaks-html/lib → lib}/yaks/format/html.rb +0 -0
- data/{yaks-html/lib → lib}/yaks/format/template.html +0 -0
- data/{yaks-html/spec → spec}/spec_helper.rb +0 -0
- data/{yaks-html/yaks-html.gemspec → yaks-html.gemspec} +1 -1
- metadata +11 -108
- data/.gitignore +0 -7
- data/.travis.yml +0 -36
- data/ADDING_FORMATS.md +0 -13
- data/CHANGELOG.md +0 -149
- data/Gemfile +0 -4
- data/IDENTIFIERS.md +0 -113
- data/LICENSE +0 -7
- data/bench/bench.rb +0 -16
- data/bench/bench_1000.rb +0 -60
- data/notes.org +0 -72
- data/shaved_yak.gif +0 -0
- data/yaks-html/README.md +0 -3
- data/yaks/README.md +0 -526
- data/yaks/lib/yaks.rb +0 -62
- data/yaks/lib/yaks/breaking_changes.rb +0 -49
- data/yaks/lib/yaks/collection_mapper.rb +0 -52
- data/yaks/lib/yaks/collection_resource.rb +0 -73
- data/yaks/lib/yaks/config.rb +0 -65
- data/yaks/lib/yaks/config/dsl.rb +0 -165
- data/yaks/lib/yaks/default_policy.rb +0 -100
- data/yaks/lib/yaks/format.rb +0 -87
- data/yaks/lib/yaks/format/collection_json.rb +0 -42
- data/yaks/lib/yaks/format/hal.rb +0 -82
- data/yaks/lib/yaks/format/json_api.rb +0 -86
- data/yaks/lib/yaks/fp.rb +0 -26
- data/yaks/lib/yaks/fp/callable.rb +0 -9
- data/yaks/lib/yaks/fp/hash_updatable.rb +0 -19
- data/yaks/lib/yaks/fp/updatable.rb +0 -17
- data/yaks/lib/yaks/mapper.rb +0 -75
- data/yaks/lib/yaks/mapper/association.rb +0 -43
- data/yaks/lib/yaks/mapper/association_mapper.rb +0 -42
- data/yaks/lib/yaks/mapper/attribute.rb +0 -17
- data/yaks/lib/yaks/mapper/class_methods.rb +0 -37
- data/yaks/lib/yaks/mapper/config.rb +0 -44
- data/yaks/lib/yaks/mapper/has_many.rb +0 -29
- data/yaks/lib/yaks/mapper/has_one.rb +0 -15
- data/yaks/lib/yaks/mapper/link.rb +0 -91
- data/yaks/lib/yaks/null_resource.rb +0 -40
- data/yaks/lib/yaks/primitivize.rb +0 -45
- data/yaks/lib/yaks/resource.rb +0 -51
- data/yaks/lib/yaks/resource/link.rb +0 -21
- data/yaks/lib/yaks/runner.rb +0 -101
- data/yaks/lib/yaks/util.rb +0 -56
- data/yaks/lib/yaks/version.rb +0 -3
- data/yaks/spec/acceptance/acceptance_spec.rb +0 -48
- data/yaks/spec/acceptance/json_shared_examples.rb +0 -8
- data/yaks/spec/acceptance/models.rb +0 -48
- data/yaks/spec/fixture_helpers.rb +0 -14
- data/yaks/spec/integration/map_to_resource_spec.rb +0 -28
- data/yaks/spec/json/confucius.collection.json +0 -28
- data/yaks/spec/json/confucius.hal.json +0 -59
- data/yaks/spec/json/confucius.json_api.json +0 -51
- data/yaks/spec/json/john.hal.json +0 -29
- data/yaks/spec/json/plant_collection.collection.json +0 -32
- data/yaks/spec/json/plant_collection.hal.json +0 -34
- data/yaks/spec/json/youtypeitwepostit.collection.json +0 -45
- data/yaks/spec/spec_helper.rb +0 -30
- data/yaks/spec/support/classes_for_policy_testing.rb +0 -36
- data/yaks/spec/support/deep_eql.rb +0 -123
- data/yaks/spec/support/fixtures.rb +0 -6
- data/yaks/spec/support/friends_mapper.rb +0 -29
- data/yaks/spec/support/models.rb +0 -23
- data/yaks/spec/support/pet_mapper.rb +0 -3
- data/yaks/spec/support/pet_peeve_mapper.rb +0 -3
- data/yaks/spec/support/shared_contexts.rb +0 -57
- data/yaks/spec/support/youtypeit_models_mappers.rb +0 -20
- data/yaks/spec/unit/yaks/collection_mapper_spec.rb +0 -165
- data/yaks/spec/unit/yaks/collection_resource_spec.rb +0 -77
- data/yaks/spec/unit/yaks/config/dsl_spec.rb +0 -87
- data/yaks/spec/unit/yaks/config_spec.rb +0 -74
- data/yaks/spec/unit/yaks/default_policy/derive_mapper_from_object_spec.rb +0 -80
- data/yaks/spec/unit/yaks/default_policy_spec.rb +0 -70
- data/yaks/spec/unit/yaks/format/collection_json_spec.rb +0 -41
- data/yaks/spec/unit/yaks/format/hal_spec.rb +0 -44
- data/yaks/spec/unit/yaks/format/json_api_spec.rb +0 -42
- data/yaks/spec/unit/yaks/format_spec.rb +0 -37
- data/yaks/spec/unit/yaks/fp/callable_spec.rb +0 -13
- data/yaks/spec/unit/yaks/fp/hash_updatable_spec.rb +0 -22
- data/yaks/spec/unit/yaks/fp/updatable_spec.rb +0 -22
- data/yaks/spec/unit/yaks/fp_spec.rb +0 -31
- data/yaks/spec/unit/yaks/mapper/association_mapper_spec.rb +0 -60
- data/yaks/spec/unit/yaks/mapper/association_spec.rb +0 -135
- data/yaks/spec/unit/yaks/mapper/attribute_spec.rb +0 -20
- data/yaks/spec/unit/yaks/mapper/class_methods_spec.rb +0 -67
- data/yaks/spec/unit/yaks/mapper/config_spec.rb +0 -166
- data/yaks/spec/unit/yaks/mapper/has_many_spec.rb +0 -89
- data/yaks/spec/unit/yaks/mapper/has_one_spec.rb +0 -51
- data/yaks/spec/unit/yaks/mapper/link_spec.rb +0 -196
- data/yaks/spec/unit/yaks/mapper_spec.rb +0 -303
- data/yaks/spec/unit/yaks/null_resource_spec.rb +0 -32
- data/yaks/spec/unit/yaks/primitivize_spec.rb +0 -77
- data/yaks/spec/unit/yaks/resource/link_spec.rb +0 -20
- data/yaks/spec/unit/yaks/resource_spec.rb +0 -108
- data/yaks/spec/unit/yaks/runner_spec.rb +0 -260
- data/yaks/spec/unit/yaks/util_spec.rb +0 -49
- data/yaks/spec/yaml/confucius.yaml +0 -28
- data/yaks/spec/yaml/youtypeitwepostit.yaml +0 -9
- data/yaks/yaks.gemspec +0 -41
@@ -1,49 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
RSpec.describe Yaks::Util do
|
4
|
-
include Yaks::Util
|
5
|
-
|
6
|
-
describe '#Resolve' do
|
7
|
-
it 'should return non-proc-values' do
|
8
|
-
expect(Resolve('foo')).to eql 'foo'
|
9
|
-
end
|
10
|
-
|
11
|
-
it 'should resolve a proc' do
|
12
|
-
expect(Resolve(->{ 123 })).to eql 123
|
13
|
-
end
|
14
|
-
|
15
|
-
it 'should resolve the proc in the given context' do
|
16
|
-
expect(Resolve(->{ upcase }, 'foo')).to eql 'FOO'
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should resolve a proc without context in the context it was lexically defined' do
|
20
|
-
expect(Resolve(->{ self })).to be_a RSpec::Core::ExampleGroup
|
21
|
-
end
|
22
|
-
|
23
|
-
it 'should receive the context as an argument when it has an arity > 0' do
|
24
|
-
expect(Resolve(->(s){ s.upcase }, 'foo')).to eql 'FOO'
|
25
|
-
end
|
26
|
-
|
27
|
-
it 'should work with method objects' do
|
28
|
-
expect(Resolve('foo'.method(:upcase))).to eql 'FOO'
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
describe '#camelize' do
|
33
|
-
it 'should camelize' do
|
34
|
-
expect(camelize('foo_bar_moo/baz/booz')).to eql 'FooBarMoo::Baz::Booz'
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe '#underscore' do
|
39
|
-
it 'should underscorize' do
|
40
|
-
expect(underscore('FooBar::Baz-Quz::Quux')).to eql 'foo_bar/baz__quz/quux'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
describe '#slice_hash' do
|
45
|
-
it '#should retain the given keys from a hash' do
|
46
|
-
expect(slice_hash({a: 1, b:2, c:3}, :a, :c, :d)).to eql(a: 1, c:3)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
--- !ruby/object:Scholar
|
2
|
-
id: 9
|
3
|
-
name: "孔子"
|
4
|
-
pinyin: "Kongzi"
|
5
|
-
latinized: "Confucius"
|
6
|
-
works:
|
7
|
-
- !ruby/object:Work
|
8
|
-
id: 11
|
9
|
-
chinese_name: "論語"
|
10
|
-
english_name: "Analects"
|
11
|
-
era: !ruby/object:Era
|
12
|
-
id: 99
|
13
|
-
name: "Zhou Dynasty"
|
14
|
-
quotes:
|
15
|
-
- !ruby/object:Quote
|
16
|
-
id: 17
|
17
|
-
chinese: "廄焚。子退朝,曰:“傷人乎?” 不問馬。"
|
18
|
-
english: "When the stables were burnt down, on returning from court Confucius said, “Was anyone hurt?” He did not ask about the horses."
|
19
|
-
sources: "Analects X.11 (tr. Waley), 10–13 (tr. Legge), or X-17 (tr. Lau)"
|
20
|
-
- !ruby/object:Quote
|
21
|
-
id: 18
|
22
|
-
chinese: "子曰:“其恕乎!己所不欲、勿施於人。”"
|
23
|
-
english: "The Master replied: “How about 'reciprocity'! Never impose on others what you would not choose for yourself.”"
|
24
|
-
sources: "Analects XV.24, tr. David Hinton"
|
25
|
-
- !ruby/object:Work
|
26
|
-
id: 12
|
27
|
-
chinese_name: "易經"
|
28
|
-
english_name: "Commentaries to the Yi-jing"
|
data/yaks/yaks.gemspec
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require File.expand_path('../lib/yaks/version', __FILE__)
|
4
|
-
require File.expand_path('../lib/yaks/breaking_changes', __FILE__)
|
5
|
-
|
6
|
-
Gem::Specification.new do |gem|
|
7
|
-
gem.name = 'yaks'
|
8
|
-
gem.version = Yaks::VERSION
|
9
|
-
gem.authors = [ 'Arne Brasseur' ]
|
10
|
-
gem.email = [ 'arne@arnebrasseur.net' ]
|
11
|
-
gem.description = 'Serialize to hypermedia. HAL, JSON-API, etc.'
|
12
|
-
gem.summary = gem.description
|
13
|
-
gem.homepage = 'https://github.com/plexus/yaks'
|
14
|
-
gem.license = 'MIT'
|
15
|
-
|
16
|
-
gem.require_paths = %w[lib]
|
17
|
-
gem.files = `git ls-files`.split($/)
|
18
|
-
gem.test_files = `git ls-files -- spec`.split($/)
|
19
|
-
gem.extra_rdoc_files = %w[README.md]
|
20
|
-
|
21
|
-
if Yaks::BreakingChanges.key? Yaks::VERSION
|
22
|
-
gem.post_install_message = Yaks::BreakingChanges[Yaks::VERSION]
|
23
|
-
end
|
24
|
-
|
25
|
-
gem.add_runtime_dependency 'inflection' , '~> 1.0'
|
26
|
-
gem.add_runtime_dependency 'concord' , '~> 0.1.4'
|
27
|
-
gem.add_runtime_dependency 'uri_template' , '~> 0.6.0'
|
28
|
-
gem.add_runtime_dependency 'rack-accept' , '~> 0.4.5'
|
29
|
-
gem.add_runtime_dependency 'anima' , '~> 0.2.0'
|
30
|
-
gem.add_runtime_dependency 'adamantium' , '~> 0.2.0'
|
31
|
-
|
32
|
-
gem.add_development_dependency 'virtus'
|
33
|
-
gem.add_development_dependency 'rspec', '~> 3.0'
|
34
|
-
gem.add_development_dependency 'bogus'
|
35
|
-
gem.add_development_dependency 'rake'
|
36
|
-
gem.add_development_dependency 'yard'
|
37
|
-
gem.add_development_dependency 'mutant-rspec'
|
38
|
-
gem.add_development_dependency 'mutant'
|
39
|
-
gem.add_development_dependency 'rspec-its'
|
40
|
-
gem.add_development_dependency 'benchmark-ips'
|
41
|
-
end
|