ruby-xcdm 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- Zjc5N2MxNzBmNWIwOTNkYzdjMzc4YmEyYzVmMDI3M2YwOGUxZWZkMA==
4
+ Njc1YTAyNTBiYWFmMmMzYWMzYTFmMDk5N2QyMzUzYzg1YTdkYzk4OA==
5
5
  data.tar.gz: !binary |-
6
- ODFhYmNjZDE0OTBkNWE4OTk5YzJkMGQ1OWU1NjAyYmM0ZWU4ZWY4Nw==
6
+ YzUyZTg0YmZkYzA0NDNmYzIyZTU0YjUwNTRiYWRiZDRiMTM5YTAwOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTQxNTQwNzhjMzQ1OTkyNzljYzY5ZjgxYzJkOWM3YTgzYTIwNzVjN2YzNjU0
10
- MzcxNWNhYzUzMTEyYTVjZTM5YTVkYjc3NWMyMmExMGM3YTZiYTc3MDMwZDlh
11
- NjYzZDNiNTZhMDFlYTMzNzJmMDVkOTBiYTYxMGIxMDhmM2M1OGE=
9
+ NDBjMDQ4NTEwMjVkYTRiODIzN2Y3YzliN2Y5NTdiN2IzMGVkOGFmMDQ2MDlh
10
+ ZjQ5ZDkzOTQ3YWZhMjM1MDNlODczMzg5NTUyNWI4ZTc3YTUyNzljOGQ1ZTQ4
11
+ OGZhNWNhMjA4MzNkZGM1NWJhYTljNjgyMmEyZjZjMzRhZjRiNjg=
12
12
  data.tar.gz: !binary |-
13
- ZTcyYTJkZTM4ZmNiMDcyOWVkNDY3MzQxYjdiNDBkOTQzN2E2OWRmYjQzMmEx
14
- ODg3OTQ1NDc4ZjBjYmY1YTRmODMwNmQyMjNhYWQ2OTZmMDAxOWVkZTUzMmVj
15
- YTY3ZTgyYmQ2MDVhMjQzMTA4NTdhNGU1YzZlM2FhMGJmMDQyOWY=
13
+ YmVhMTc3OGY1OWVkMjdiZjljMWI5YWU0NjI0OTZmNmUzNDk2OTM0NTZhNmQy
14
+ NDNlZDgyNGQ2ZmFjNWRhOWY0ZTMxNGZiY2M5MmY5NmEzY2M1ZGU1ZWVhNTMx
15
+ M2U5MzQ2MWFjM2I2OGMyMGE4ZWU3OTcxNDkyNGUzMWIyZTZlNWI=
data/README.md CHANGED
@@ -1,24 +1,30 @@
1
1
  # ruby-xcdm
2
2
 
3
- This is a tool for generating the same xcdatamodeld files that XCode does when
4
- designing a datamodel for Core Data. It is written in pure ruby, but it will
5
- be of particular interest to RubyMotion developers. It offers the essential
6
- features that XCode does, plus a text-based workflow (nicer for git, among
7
- other things) and some niceties, like automatic inverse relationships.
3
+ This is a tool for generating the same xcdatamodeld files that XCode
4
+ does when designing a datamodel for Core Data. It is written in pure
5
+ ruby, but it will be of particular interest to RubyMotion developers.
6
+ It offers the essential features that XCode does, plus a text-based
7
+ workflow and some niceties, like automatic inverse relationships.
8
8
 
9
9
  ## Installation
10
10
 
11
11
  Add this line to your application's Gemfile:
12
12
 
13
- gem 'ruby-xcdm'
13
+ ```ruby
14
+ gem 'ruby-xcdm'
15
+ ```
14
16
 
15
17
  And then execute:
16
18
 
17
- $ bundle
19
+ ```
20
+ $ bundle
21
+ ```
18
22
 
19
23
  Or install it yourself as:
20
24
 
21
- $ gem install ruby-xcdm
25
+ ```
26
+ $ gem install ruby-xcdm
27
+ ```
22
28
 
23
29
  ## Usage (RubyMotion)
24
30
 
@@ -26,8 +32,8 @@ Or install it yourself as:
26
32
  2. Create one schema version per file within the directory
27
33
  3. To build the schema, run `rake schema:build`
28
34
 
29
- If you want to build the schema every time you run the simulator, add this to
30
- your Rakefile:
35
+ If you want to build the schema every time you run the simulator, add
36
+ this to your Rakefile:
31
37
 
32
38
  ```ruby
33
39
  task :"build:simulator" => :"schema:build"
@@ -39,7 +45,9 @@ task :"build:simulator" => :"schema:build"
39
45
  2. Create one schema version per file within the directory
40
46
  3. Run the command to generate a datamodel:
41
47
 
48
+ ```
42
49
  xcdm MyApplicationName schemadir datamodeldestdir
50
+ ```
43
51
 
44
52
 
45
53
  ## Schema File Format
@@ -47,7 +55,7 @@ task :"build:simulator" => :"schema:build"
47
55
  Here's a sample schema file:
48
56
 
49
57
  ```ruby
50
- schema "0.0.1" do
58
+ schema "001" do
51
59
 
52
60
  entity "Article" do
53
61
 
@@ -69,10 +77,53 @@ Here's a sample schema file:
69
77
  end
70
78
  ```
71
79
 
72
- All the built-in data types are supported, and inverse relationships are
73
- generated automatically. If you need to set some of the more esoteric options
74
- on properties or relationships, you can include the raw parameters, like
75
- renamingIdentifier or defaultValueString.
80
+ All the built-in data types are supported:
81
+
82
+ * integer16
83
+ * integer32
84
+ * integer64
85
+ * decimal
86
+ * double
87
+ * float
88
+ * string
89
+ * boolean
90
+ * datetime
91
+ * binary
92
+ * transformable
93
+
94
+ Inverse relationships are generated automatically.
95
+ If the inverse relationship cannot be derived
96
+ from the association name, you can use the :inverse option:
97
+
98
+ ```ruby
99
+ schema "001" do
100
+
101
+ entity "Game" do
102
+ belongs_to :away_team, inverse: "Team.away_games"
103
+ belongs_to :home_team, inverse: "Team.home_games"
104
+ end
105
+
106
+ entity "Team" do
107
+ has_many :away_games, inverse: "Game.away_team"
108
+ has_many :home_games, inverse: "Game.home_team"
109
+ end
110
+
111
+ end
112
+ ```
113
+
114
+ If you need to set some of the more esoteric options on properties or
115
+ relationships, you can include the raw parameters from
116
+ NSEntityDescription and NSAttributeDescription, like renamingIdentifier
117
+ or defaultValueString.
118
+
119
+ ## Versioning
120
+
121
+ To create new versions, simply copy the old version, increase the
122
+ version string (the last one in sort order is always interpreted to be
123
+ the current version) and make your changes. So long as they conform
124
+ to the [automatic versioning
125
+ rules](https://developer.apple.com/library/ios/documentation/cocoa/conceptual/CoreDataVersioning/Articles/vmLightweightMigration.html#//apple_ref/doc/uid/TP40004399-CH4-SW2),
126
+ everything should work seamlessly.
76
127
 
77
128
  ## Contributing
78
129
 
@@ -19,7 +19,7 @@ module XCDM
19
19
  string: 'String',
20
20
  boolean: 'Boolean',
21
21
  datetime: 'Date',
22
- binary: 'Binary Data',
22
+ binary: 'Binary',
23
23
  transformable: 'Transformable'
24
24
  }
25
25
 
@@ -1,3 +1,3 @@
1
1
  module XCDM
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -55,7 +55,7 @@ module XCDM
55
55
  assert_equal 'String', Entity.convert_type(:string)
56
56
  assert_equal 'Boolean', Entity.convert_type(:boolean)
57
57
  assert_equal 'Date', Entity.convert_type(:datetime)
58
- assert_equal 'Binary Data', Entity.convert_type(:binary)
58
+ assert_equal 'Binary', Entity.convert_type(:binary)
59
59
  assert_equal 'Transformable', Entity.convert_type(:transformable)
60
60
  end
61
61
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-xcdm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Miller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-14 00:00:00.000000000 Z
11
+ date: 2014-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder