ruby-xcdm 0.0.7 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.ruby-version +1 -1
- data/Gemfile +2 -1
- data/Gemfile.lock +28 -12
- data/README.md +52 -6
- data/lib/ruby-xcdm.rb +14 -4
- data/lib/xcdm/entity.rb +7 -2
- data/lib/xcdm/schema.rb +13 -4
- data/lib/xcdm/version.rb +1 -1
- data/ruby-xcdm.gemspec +3 -2
- data/test/entity_test.rb +20 -7
- data/test/fixtures/001_baseline.rb +2 -2
- data/test/fixtures/Article.xcdatamodeld/Article.xcdatamodel/contents +2 -2
- data/test/schema_test.rb +5 -5
- metadata +26 -41
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8f74769db3ae3dc3469e48ac7f4170722b3dac5ece25b34b0430844f557771a4
|
4
|
+
data.tar.gz: 0140b6cfe2531b42ad5aed52155898b7466933f1e6ba64bfc3bc5f0ff5fa29d0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: bb8a2b741578857bc5f677d388ee399c6f8951065575c7fda94ecbe25930fddca3a039fae42d3d2650d7c496c802788444f56ab0e625d0405925409f365ac064
|
7
|
+
data.tar.gz: d957261be44ede928b726f4ca9fde29b9c9d6aff81d1600e258c542f1e5f7d98a3598636ab9d56264e57511af0ddcba2140b8cabcee69f1d608038840861b7ca
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
2.7.2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,17 +1,29 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
ruby-xcdm (1.0.0)
|
5
|
+
activesupport (~> 4.1)
|
6
|
+
builder (~> 3.2)
|
7
|
+
plist (~> 3.1)
|
8
|
+
|
1
9
|
GEM
|
2
10
|
remote: https://rubygems.org/
|
3
11
|
specs:
|
4
|
-
activesupport (
|
5
|
-
i18n (
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
activesupport (4.2.11.3)
|
13
|
+
i18n (~> 0.7)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
16
|
+
tzinfo (~> 1.1)
|
17
|
+
builder (3.2.4)
|
18
|
+
concurrent-ruby (1.1.8)
|
19
|
+
i18n (0.9.5)
|
20
|
+
concurrent-ruby (~> 1.0)
|
21
|
+
minitest (5.14.3)
|
22
|
+
plist (3.6.0)
|
23
|
+
rake (13.0.3)
|
24
|
+
thread_safe (0.3.6)
|
25
|
+
tzinfo (1.2.9)
|
26
|
+
thread_safe (~> 0.1)
|
15
27
|
|
16
28
|
PLATFORMS
|
17
29
|
ruby
|
@@ -19,6 +31,10 @@ PLATFORMS
|
|
19
31
|
DEPENDENCIES
|
20
32
|
activesupport
|
21
33
|
builder
|
34
|
+
minitest
|
22
35
|
plist
|
23
36
|
rake
|
24
|
-
|
37
|
+
ruby-xcdm!
|
38
|
+
|
39
|
+
BUNDLED WITH
|
40
|
+
2.2.11
|
data/README.md
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
# ruby-xcdm
|
2
2
|
|
3
|
-
This is a tool for generating the same xcdatamodeld files that
|
3
|
+
This is a tool for generating the same xcdatamodeld files that Xcode
|
4
4
|
does when designing a datamodel for Core Data. It is written in pure
|
5
5
|
ruby, but it will be of particular interest to RubyMotion developers.
|
6
|
-
It offers the essential features that
|
6
|
+
It offers the essential features that Xcode does, plus a text-based
|
7
7
|
workflow and some niceties, like automatic inverse relationships.
|
8
8
|
|
9
|
+
[![Dependency Status](https://gemnasium.com/infinitered/ruby-xcdm.png)](https://gemnasium.com/infinitered/ruby-xcdm)
|
10
|
+
[![Build Status](https://travis-ci.org/infinitered/ruby-xcdm.png?branch=master)](https://travis-ci.org/infinitered/ruby-xcdm)
|
11
|
+
[![Gem Version](https://badge.fury.io/rb/ruby-xcdm.png)](http://badge.fury.io/rb/ruby-xcdm)
|
12
|
+
|
13
|
+
ruby-xcdm is maintained by [Infinite Red](http://infinite.red), a web and mobile development company based in Portland, OR and San Francisco, CA.
|
14
|
+
|
9
15
|
## Installation
|
10
16
|
|
11
17
|
Add this line to your application's Gemfile:
|
@@ -39,6 +45,13 @@ this to your Rakefile:
|
|
39
45
|
task :"build:simulator" => :"schema:build"
|
40
46
|
```
|
41
47
|
|
48
|
+
You can override the name of the datamodel file, if you need to, using a config
|
49
|
+
variable:
|
50
|
+
|
51
|
+
```ruby
|
52
|
+
app.xcdm.name = "custom"
|
53
|
+
```
|
54
|
+
|
42
55
|
## Usage (Plain Ruby)
|
43
56
|
|
44
57
|
1. Make a directory to hold your schemas (a.k.a. data model in XCode parlance)
|
@@ -46,7 +59,7 @@ task :"build:simulator" => :"schema:build"
|
|
46
59
|
3. Run the command to generate a datamodel:
|
47
60
|
|
48
61
|
```
|
49
|
-
xcdm MyApplicationName
|
62
|
+
xcdm MyApplicationName ./schema ./resources
|
50
63
|
```
|
51
64
|
|
52
65
|
|
@@ -62,7 +75,7 @@ Here's a sample schema file:
|
|
62
75
|
string :body, optional: false
|
63
76
|
integer32 :length
|
64
77
|
boolean :published, default: false
|
65
|
-
datetime :publishedAt
|
78
|
+
datetime :publishedAt
|
66
79
|
string :title, optional: false
|
67
80
|
|
68
81
|
belongs_to :author
|
@@ -82,7 +95,7 @@ All the built-in data types are supported:
|
|
82
95
|
* integer16
|
83
96
|
* integer32
|
84
97
|
* integer64
|
85
|
-
* decimal
|
98
|
+
* decimal (See note below)
|
86
99
|
* double
|
87
100
|
* float
|
88
101
|
* string
|
@@ -91,6 +104,8 @@ All the built-in data types are supported:
|
|
91
104
|
* binary
|
92
105
|
* transformable
|
93
106
|
|
107
|
+
NSDecimal is not well-supported in RubyMotion as of this writing. They are converted to floats and lose precision. HipByte is aware of the issue and intends to fix it, but until they do, you will need to use something else for storing currency. For an example, see [here](https://github.com/skandragon/stringify_float).
|
108
|
+
|
94
109
|
Inverse relationships are generated automatically.
|
95
110
|
If the inverse relationship cannot be derived
|
96
111
|
from the association name, you can use the ```:inverse``` option:
|
@@ -139,7 +154,38 @@ scenes. If you want more control, you can make the intermediate table yourself:
|
|
139
154
|
end
|
140
155
|
```
|
141
156
|
|
142
|
-
|
157
|
+
You can also have symmetric one-to-one relationships via has_one:
|
158
|
+
|
159
|
+
```ruby
|
160
|
+
entity "Person" do
|
161
|
+
has_one :ego
|
162
|
+
end
|
163
|
+
|
164
|
+
entity "Ego" do
|
165
|
+
has_one :person
|
166
|
+
end
|
167
|
+
```
|
168
|
+
|
169
|
+
Deletion rules can be easily set on relationships and the default rule is "Nullify":
|
170
|
+
|
171
|
+
```ruby
|
172
|
+
entity "Discussion" do
|
173
|
+
has_many :messages, deletionRule: "Cascade"
|
174
|
+
end
|
175
|
+
|
176
|
+
entity "Message" do
|
177
|
+
belongs_to :discusion
|
178
|
+
end
|
179
|
+
|
180
|
+
# Example:
|
181
|
+
# Discussion.first.messages.count => 10
|
182
|
+
# Messages.count => 10
|
183
|
+
# Discussion.first.destroy
|
184
|
+
# cdq.save
|
185
|
+
# Messages.count => 0
|
186
|
+
```
|
187
|
+
|
188
|
+
Core Data has no equivalent of ```:through``` in ActiveRecord, so you'll
|
143
189
|
need to handle that relation yourself.
|
144
190
|
|
145
191
|
If you need to set some of the more esoteric options on properties or
|
data/lib/ruby-xcdm.rb
CHANGED
@@ -3,12 +3,21 @@ require 'xcdm/entity'
|
|
3
3
|
|
4
4
|
if defined?(Motion::Project::Config)
|
5
5
|
|
6
|
+
class Motion::Project::Config
|
7
|
+
variable :xcdm
|
8
|
+
|
9
|
+
def xcdm
|
10
|
+
@xcdm ||= Struct.new(:name).new(nil)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
6
14
|
if File.directory?(File.join(App.config.project_dir, "schemas"))
|
7
15
|
namespace :schema do
|
8
16
|
|
9
17
|
desc "Clear the datamodel outputs"
|
10
18
|
task :clean do
|
11
|
-
|
19
|
+
App.config.xcdm.name ||= App.config.name
|
20
|
+
files = Dir.glob(File.join(App.config.project_dir, 'resources', App.config.xcdm.name) + ".{momd,xcdatamodeld}")
|
12
21
|
files.each do |f|
|
13
22
|
rm_rf f
|
14
23
|
end
|
@@ -16,14 +25,15 @@ if defined?(Motion::Project::Config)
|
|
16
25
|
|
17
26
|
desc "Generate the xcdatamodel file"
|
18
27
|
task :build => :clean do
|
28
|
+
App.config.xcdm.name ||= App.config.name
|
19
29
|
Dir.chdir App.config.project_dir
|
20
|
-
if `xcodebuild -version` =~ /Xcode (\d
|
30
|
+
if `xcodebuild -version` =~ /Xcode (\d+.\d+)/
|
21
31
|
xcode_version = $1
|
22
32
|
else
|
23
33
|
raise "could not determine xcode version"
|
24
34
|
end
|
25
|
-
runner = XCDM::Schema::Runner.new( App.config.name, "schemas", "resources", App.config.sdk_version)
|
26
|
-
App.info "Generating", "Data Model #{App.config.name}"
|
35
|
+
runner = XCDM::Schema::Runner.new( App.config.xcdm.name, "schemas", "resources", App.config.sdk_version)
|
36
|
+
App.info "Generating", "Data Model #{App.config.xcdm.name}"
|
27
37
|
runner.load_all { |schema, file| App.info "Loading", file }
|
28
38
|
runner.write_all { |schema, file| App.info "Writing", file }
|
29
39
|
end
|
data/lib/xcdm/entity.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
require 'active_support/
|
2
|
+
require 'active_support/inflector'
|
3
3
|
require 'builder'
|
4
4
|
|
5
5
|
module XCDM
|
@@ -140,7 +140,12 @@ module XCDM
|
|
140
140
|
|
141
141
|
def to_xml(builder = nil)
|
142
142
|
builder ||= Builder::XmlMarkup.new(:indent => 2)
|
143
|
-
options = {
|
143
|
+
options = {
|
144
|
+
name: name,
|
145
|
+
syncable: 'YES',
|
146
|
+
representedClassName: class_name,
|
147
|
+
codeGenerationType: 'class'
|
148
|
+
}.merge(@options)
|
144
149
|
builder.entity(options) do |xml|
|
145
150
|
properties.each do |property|
|
146
151
|
xml.attribute(property)
|
data/lib/xcdm/schema.rb
CHANGED
@@ -30,7 +30,7 @@ module XCDM
|
|
30
30
|
name: "",
|
31
31
|
userDefinedModelVersionIdentifier: version,
|
32
32
|
type: "com.apple.IDECoreDataModeler.DataModel",
|
33
|
-
documentVersion: "1.0",
|
33
|
+
documentVersion: "1.0",
|
34
34
|
lastSavedToolsVersion: "3389",
|
35
35
|
systemVersion: "12E55",
|
36
36
|
minimumToolsVersion: "Xcode 5",
|
@@ -42,7 +42,7 @@ module XCDM
|
|
42
42
|
name: "",
|
43
43
|
userDefinedModelVersionIdentifier: version,
|
44
44
|
type: "com.apple.IDECoreDataModeler.DataModel",
|
45
|
-
documentVersion: "1.0",
|
45
|
+
documentVersion: "1.0",
|
46
46
|
lastSavedToolsVersion: "2061",
|
47
47
|
systemVersion: "12D78",
|
48
48
|
minimumToolsVersion: "Xcode 4.3",
|
@@ -71,7 +71,7 @@ module XCDM
|
|
71
71
|
def schema(version, options = {}, &block)
|
72
72
|
xcv = options[:xcode_version] || xcode_version
|
73
73
|
@found_schema = Schema.new(version, xcv).tap { |s| s.instance_eval(&block) }
|
74
|
-
@schemas << @found_schema
|
74
|
+
@schemas << @found_schema
|
75
75
|
end
|
76
76
|
|
77
77
|
def load_file(file)
|
@@ -84,10 +84,19 @@ module XCDM
|
|
84
84
|
end
|
85
85
|
|
86
86
|
class Runner
|
87
|
-
def initialize(name, inpath, outpath, xcode_version)
|
87
|
+
def initialize(name, inpath, outpath, xcode_version = nil)
|
88
88
|
@inpath = inpath
|
89
89
|
@name = name
|
90
90
|
@container_path = File.join(outpath, "#{name}.xcdatamodeld")
|
91
|
+
if !xcode_version
|
92
|
+
begin
|
93
|
+
`xcodebuild -version` =~ /(\d+\.\d+\.\d+)/
|
94
|
+
xcode_version = $1
|
95
|
+
rescue => e
|
96
|
+
p e
|
97
|
+
puts "XCode not installed?"
|
98
|
+
end
|
99
|
+
end
|
91
100
|
@loader = Loader.new(xcode_version)
|
92
101
|
end
|
93
102
|
|
data/lib/xcdm/version.rb
CHANGED
data/ruby-xcdm.gemspec
CHANGED
@@ -17,12 +17,13 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
|
+
spec.required_ruby_version = '~> 2.7'
|
20
21
|
|
21
22
|
spec.add_dependency "builder", "~> 3.2"
|
22
|
-
spec.add_dependency "activesupport", "~>
|
23
|
+
spec.add_dependency "activesupport", "~> 4.1"
|
23
24
|
spec.add_dependency "plist", "~> 3.1"
|
24
25
|
|
25
|
-
spec.add_development_dependency "bundler", "~>
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.2"
|
26
27
|
spec.add_development_dependency "rake"
|
27
28
|
spec.add_development_dependency "turn"
|
28
29
|
end
|
data/test/entity_test.rb
CHANGED
@@ -1,16 +1,15 @@
|
|
1
|
-
|
2
|
-
require 'test/unit'
|
1
|
+
require 'minitest/autorun'
|
3
2
|
require 'xcdm/entity'
|
4
|
-
require '
|
3
|
+
require 'xcdm/schema'
|
5
4
|
require 'rexml/document'
|
6
5
|
|
7
6
|
module XCDM
|
8
|
-
class EntityTest < Test
|
7
|
+
class EntityTest < Minitest::Test
|
9
8
|
|
10
9
|
attr_reader :e, :pub
|
11
10
|
|
12
11
|
def setup
|
13
|
-
s = Schema.new("0.0.1", "4.6")
|
12
|
+
s = XCDM::Schema.new("0.0.1", "4.6")
|
14
13
|
@pub ||= Entity.new(s, "Publication", abstract: true)
|
15
14
|
@e ||= Entity.new(s, "Article", parent: "Publication")
|
16
15
|
end
|
@@ -92,6 +91,13 @@ module XCDM
|
|
92
91
|
"Author", inverseName: "article", inverseEntity: "Author" }], e.relationships
|
93
92
|
end
|
94
93
|
|
94
|
+
def test_has_one_should_not_plural
|
95
|
+
e.has_one 'address'
|
96
|
+
assert_equal [{ optional: "YES", deletionRule: "Nullify", syncable: "YES",
|
97
|
+
name: "address", minCount: "1", maxCount: "1", destinationEntity:
|
98
|
+
"Address", inverseName: "article", inverseEntity: "Address" }], e.relationships
|
99
|
+
end
|
100
|
+
|
95
101
|
def test_belongs_to
|
96
102
|
e.belongs_to 'author'
|
97
103
|
assert_equal [{ optional: "YES", deletionRule: "Nullify", syncable: "YES",
|
@@ -106,6 +112,13 @@ module XCDM
|
|
106
112
|
"Author", inverseName: "article", inverseEntity: "Author" }], e.relationships
|
107
113
|
end
|
108
114
|
|
115
|
+
def test_deletion_cascade
|
116
|
+
e.has_many 'authors', { deletionRule: 'Cascade'}
|
117
|
+
assert_equal [{ optional: "YES", deletionRule: "Cascade", syncable: "YES",
|
118
|
+
name: "authors", minCount: "1", maxCount: "-1", destinationEntity:
|
119
|
+
"Author", inverseName: "article", inverseEntity: "Author" }], e.relationships
|
120
|
+
end
|
121
|
+
|
109
122
|
def test_non_inferrable_relationship_with_inverse
|
110
123
|
e.belongs_to 'primary_author', inverse: 'Author.primary_articles'
|
111
124
|
assert_equal [{ optional: "YES", deletionRule: "Nullify", syncable: "YES",
|
@@ -115,7 +128,7 @@ module XCDM
|
|
115
128
|
|
116
129
|
def test_to_xml
|
117
130
|
expected = REXML::Document.new %{
|
118
|
-
<entity name="Article" representedClassName="Article" parentEntity="Publication" syncable="YES">
|
131
|
+
<entity name="Article" codeGenerationType='class' representedClassName="Article" parentEntity="Publication" syncable="YES">
|
119
132
|
<attribute name="body" optional="NO" attributeType="String" syncable="YES"/>
|
120
133
|
<attribute name="length" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
|
121
134
|
<attribute name="published" optional="YES" attributeType="Boolean" defaultValueString="NO" syncable="YES"/>
|
@@ -136,7 +149,7 @@ module XCDM
|
|
136
149
|
assert_equal expected.to_s.strip, REXML::Document.new(e.to_xml).to_s.strip
|
137
150
|
|
138
151
|
expected = REXML::Document.new %{
|
139
|
-
<entity name="Publication" representedClassName="Publication" isAbstract="YES" syncable="YES">
|
152
|
+
<entity name="Publication" representedClassName="Publication" codeGenerationType='class' isAbstract="YES" syncable="YES">
|
140
153
|
</entity>
|
141
154
|
}
|
142
155
|
|
@@ -25,7 +25,7 @@ __END__
|
|
25
25
|
|
26
26
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
27
27
|
<model name="" userDefinedModelVersionIdentifier="0.0.1" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="2061" systemVersion="12D78" minimumToolsVersion="Xcode 4.3" macOSVersion="Automatic" iOSVersion="Automatic">
|
28
|
-
<entity name="Article" syncable="YES">
|
28
|
+
<entity name="Article" syncable="YES" codeGenerationType='class'>
|
29
29
|
<attribute name="body" optional="YES" attributeType="String" syncable="YES"/>
|
30
30
|
<attribute name="length" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
|
31
31
|
<attribute name="published" optional="YES" attributeType="Boolean" syncable="YES"/>
|
@@ -33,7 +33,7 @@ __END__
|
|
33
33
|
<attribute name="title" optional="YES" attributeType="String" syncable="YES"/>
|
34
34
|
<relationship name="author" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Author" inverseName="articles" inverseEntity="Article" syncable="YES"/>
|
35
35
|
</entity>
|
36
|
-
<entity name="Author" syncable="YES">
|
36
|
+
<entity name="Author" syncable="YES" codeGenerationType='class'>
|
37
37
|
<attribute name="fee" optional="YES" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
|
38
38
|
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>
|
39
39
|
<relationship name="articles" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Article" inverseName="author" inverseEntity="Author" syncable="YES"/>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
2
2
|
<model name="" userDefinedModelVersionIdentifier="0.0.1" type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="2061" systemVersion="12D78" minimumToolsVersion="Xcode 4.3" macOSVersion="Automatic" iOSVersion="Automatic">
|
3
|
-
<entity name="Article" representedClassName="Article" syncable="YES">
|
3
|
+
<entity codeGenerationType="class" name="Article" representedClassName="Article" syncable="YES">
|
4
4
|
<attribute name="body" optional="NO" attributeType="String" syncable="YES"/>
|
5
5
|
<attribute name="length" optional="YES" attributeType="Integer 32" defaultValueString="0" syncable="YES"/>
|
6
6
|
<attribute name="published" optional="YES" attributeType="Boolean" defaultValueString="NO" syncable="YES"/>
|
@@ -8,7 +8,7 @@
|
|
8
8
|
<attribute name="title" optional="NO" attributeType="String" syncable="YES"/>
|
9
9
|
<relationship name="author" optional="YES" minCount="1" maxCount="1" deletionRule="Nullify" destinationEntity="Author" inverseName="articles" inverseEntity="Author" syncable="YES"/>
|
10
10
|
</entity>
|
11
|
-
<entity name="Author" representedClassName="Author" syncable="YES">
|
11
|
+
<entity codeGenerationType="class" name="Author" representedClassName="Author" syncable="YES">
|
12
12
|
<attribute name="fee" optional="YES" attributeType="Float" defaultValueString="0.0" syncable="YES"/>
|
13
13
|
<attribute name="name" optional="NO" attributeType="String" syncable="YES"/>
|
14
14
|
<relationship name="articles" optional="YES" minCount="1" maxCount="-1" deletionRule="Nullify" destinationEntity="Article" inverseName="author" inverseEntity="Article" syncable="YES"/>
|
data/test/schema_test.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
|
2
|
-
require '
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'xcdm/entity'
|
3
3
|
require 'xcdm/schema'
|
4
4
|
require 'rexml/document'
|
5
|
-
require 'active_support/
|
5
|
+
require 'active_support/inflector'
|
6
6
|
|
7
7
|
module XCDM
|
8
|
-
class SchemaTest < Test
|
8
|
+
class SchemaTest < Minitest::Test
|
9
9
|
|
10
10
|
def test_initialize
|
11
11
|
s = Schema.new("0.0.1", "4.6")
|
@@ -26,7 +26,7 @@ module XCDM
|
|
26
26
|
|
27
27
|
loader = Schema::Loader.new("4.6")
|
28
28
|
schema = loader.load_file(fixture)
|
29
|
-
|
29
|
+
assert_equal schema.nil?, false
|
30
30
|
assert_equal '0.0.1', schema.version
|
31
31
|
assert_equal schema, loader.schemas.first
|
32
32
|
assert_equal ['Article', 'Author'], schema.entities.map(&:name)
|
metadata
CHANGED
@@ -1,110 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-xcdm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Ken Miller
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: builder
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '3.2'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '3.2'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: activesupport
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: '
|
33
|
+
version: '4.1'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: '
|
40
|
+
version: '4.1'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: plist
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- - ~>
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '3.1'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- - ~>
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '3.1'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: bundler
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- - ~>
|
59
|
+
- - "~>"
|
68
60
|
- !ruby/object:Gem::Version
|
69
|
-
version: '
|
61
|
+
version: '2.2'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- - ~>
|
66
|
+
- - "~>"
|
76
67
|
- !ruby/object:Gem::Version
|
77
|
-
version: '
|
68
|
+
version: '2.2'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: rake
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: turn
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
description: Ruby DSL for creating Core Data Data Model files without XCode
|
@@ -115,8 +102,8 @@ executables:
|
|
115
102
|
extensions: []
|
116
103
|
extra_rdoc_files: []
|
117
104
|
files:
|
118
|
-
- .gitignore
|
119
|
-
- .ruby-version
|
105
|
+
- ".gitignore"
|
106
|
+
- ".ruby-version"
|
120
107
|
- Gemfile
|
121
108
|
- Gemfile.lock
|
122
109
|
- LICENSE.txt
|
@@ -136,27 +123,25 @@ files:
|
|
136
123
|
homepage: https://github.com/infinitered/ruby-xcdm
|
137
124
|
licenses:
|
138
125
|
- MIT
|
126
|
+
metadata: {}
|
139
127
|
post_install_message:
|
140
128
|
rdoc_options: []
|
141
129
|
require_paths:
|
142
130
|
- lib
|
143
131
|
required_ruby_version: !ruby/object:Gem::Requirement
|
144
|
-
none: false
|
145
132
|
requirements:
|
146
|
-
- -
|
133
|
+
- - "~>"
|
147
134
|
- !ruby/object:Gem::Version
|
148
|
-
version: '
|
135
|
+
version: '2.7'
|
149
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
|
-
none: false
|
151
137
|
requirements:
|
152
|
-
- -
|
138
|
+
- - ">="
|
153
139
|
- !ruby/object:Gem::Version
|
154
140
|
version: '0'
|
155
141
|
requirements: []
|
156
|
-
|
157
|
-
rubygems_version: 1.8.23
|
142
|
+
rubygems_version: 3.1.4
|
158
143
|
signing_key:
|
159
|
-
specification_version:
|
144
|
+
specification_version: 4
|
160
145
|
summary: Ruby XCDM
|
161
146
|
test_files:
|
162
147
|
- test/entity_test.rb
|