gyro 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 15960f1f9c3d4bdb80d4cd3edfb5a7380b79c72c
4
- data.tar.gz: 58e1994395f309312e639e61287a80ae0a00514b
3
+ metadata.gz: 3f72b04e5d34ad6d93bb6a96d8c206be24d8f0f9
4
+ data.tar.gz: be4c052362fa59db8bad14c5e3a0946004b36b02
5
5
  SHA512:
6
- metadata.gz: b270fc1099b7e5485179085b1e88666d4e95270fb3ab3188a5987924cfcc19f2809e9a044e748869e88f999be9c61ab8bba700774e46b9bf8fa89c2105bfcf8a
7
- data.tar.gz: 718cce84c7e01a71f5dd35ea8898a79220ac6dc50aeee8cf7f995bd6aeafd2411b211b8ff87e43dec9141750b836efaef4d11a38c6c86fb1c0e52d13c5dc8caf
6
+ metadata.gz: fc6c81d67e271ceabddacab4e1a88c303af9a49040af39d3f1b8b48a11632733364edabd4f2d294b09aa9a8b0254ace8532c465b360d4ce809eba4bda8b214b1
7
+ data.tar.gz: 377f9d34d0a560f07e0af33c5a693ac5ff0579ebf70ecafc128dfff7a3abaf87c1c49448bd194f0e3d4f2554e6d274ab03d374e5cb86f1a20a69ff8c8c7c1b24
data/lib/gyro/version.rb CHANGED
@@ -15,5 +15,5 @@
15
15
  # Gyro Version
16
16
  #
17
17
  module Gyro
18
- VERSION = '1.1.0'.freeze
18
+ VERSION = '1.2.0'.freeze
19
19
  end
@@ -4,11 +4,11 @@
4
4
  | --------- | ----------------- |
5
5
  | Folder name | templates/swift3 |
6
6
  | Invocation example | `gyro -m <model> -t swift3 …` |
7
- | Language | Swift 3 |
7
+ | Language | Swift 3 and Swift 4 |
8
8
 
9
9
  # When to use it
10
10
 
11
- This template is the reference for swift 3 with Realm generation code.
11
+ This template is the reference for swift 3 with Realm generation code. This template is compatible with swift 4.
12
12
  You can use it when you need to work with `Realm`
13
13
 
14
14
  # Caracteristics
@@ -20,7 +20,7 @@ In this template optional Realm objects (Attributes - RealmOptional - or Relatio
20
20
  {%- if attribute.is_number == true or attribute.is_bool == true %}
21
21
  let {{ attribute.name }} = RealmOptional<{{ convert_type }}>()
22
22
  {%- else %}
23
- dynamic var {{ attribute.name }}: {{ convert_type }}?
23
+ @objc dynamic var {{ attribute.name }}: {{ convert_type }}?
24
24
  {%- endif -%}
25
25
 
26
26
  // Relationship generation
@@ -28,7 +28,7 @@ In this template optional Realm objects (Attributes - RealmOptional - or Relatio
28
28
  {%- if relationship.type == "to_many" %}
29
29
  let {{ relationship.name }} = List<{{ relationship.inverse_type }}>()
30
30
  {%- else %}
31
- dynamic var {{ relationship.name }}: {{ relationship.inverse_type }}?
31
+ @objc dynamic var {{ relationship.name }}: {{ relationship.inverse_type }}?
32
32
  {%- endif %}
33
33
  {%- endif %}
34
34
  ```
@@ -52,10 +52,10 @@ final class Product: Object {
52
52
  case users = "users"
53
53
  }
54
54
 
55
- dynamic var brand: String?
56
- dynamic var name: String = ""
55
+ @objc dynamic var brand: String?
56
+ @objc dynamic var name: String = ""
57
57
  let price = RealmOptional<Int32>()
58
-
58
+
59
59
  let users = List<Users>()
60
60
  }
61
61
  ```
@@ -19,7 +19,7 @@
19
19
  {%- include 'inc/optional_attribute_property' -%}
20
20
  {%- else -%}
21
21
  {%- comment -%} ******* GENERATE DEFAULT ATTRIBUTE PROPERTY ******* {% endcomment %}
22
- dynamic var {{ attribute.name }}: {{ convert_type }} = {{ default_value }}
22
+ @objc dynamic var {{ attribute.name }}: {{ convert_type }} = {{ default_value }}
23
23
  {%- endif -%}
24
24
  {%- endif -%}
25
25
  {%- endif -%}
@@ -29,4 +29,4 @@
29
29
  {%- include 'inc/relationship_properties' -%}
30
30
 
31
31
  {%- comment %} ******* GENERATE INVERSE PROPERTIES ******* {% endcomment -%}
32
- {%- include 'inc/inverse_properties' -%}
32
+ {%- include 'inc/inverse_properties' -%}
@@ -1,9 +1,9 @@
1
1
  {%- if attribute.optional == true %}
2
2
 
3
- dynamic var {{ attribute.name }}: String?
3
+ @objc dynamic var {{ attribute.name }}: String?
4
4
  {%- else %}
5
5
 
6
- dynamic var {{ attribute.name }}: String = ""
6
+ @objc dynamic var {{ attribute.name }}: String = ""
7
7
  {%- endif %}
8
8
  {%- assign enum_type = attribute.enum_type %}
9
9
  {%- assign enum_name = attribute.name %}
@@ -1,5 +1,5 @@
1
1
  {%- if attribute.is_number == true or attribute.is_bool == true %}
2
2
  let {{ attribute.name }} = RealmOptional<{{ convert_type }}>()
3
3
  {%- else %}
4
- dynamic var {{ attribute.name }}: {{ convert_type }}?
5
- {%- endif -%}
4
+ @objc dynamic var {{ attribute.name }}: {{ convert_type }}?
5
+ {%- endif -%}
@@ -3,7 +3,7 @@
3
3
  {%- if relationship.type == "to_many" %}
4
4
  let {{ relationship.name }} = List<{{ relationship.inverse_type }}>()
5
5
  {%- else %}
6
- dynamic var {{ relationship.name }}: {{ relationship.inverse_type }}?
6
+ @objc dynamic var {{ relationship.name }}: {{ relationship.inverse_type }}?
7
7
  {%- endif %}
8
8
  {%- endif %}
9
- {%- endfor -%}
9
+ {%- endfor -%}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gyro
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - NijiDigital