ProMotion-formotion 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ProMotion-formotion (0.0.1)
4
+ ProMotion-formotion (0.0.5)
5
5
  ProMotion (~> 0.4.1)
6
6
  formotion (~> 1.1.4)
7
7
 
@@ -1,5 +1,5 @@
1
1
  # -*- encoding: utf-8 -*-
2
- require File.expand_path('../lib/ProMotion/version-formotion', __FILE__)
2
+ require File.expand_path('../lib/ProMotion/formotion/version', __FILE__)
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["Stephan Toggweiler"]
@@ -18,8 +18,8 @@ Gem::Specification.new do |gem|
18
18
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
19
19
  gem.name = "ProMotion-formotion"
20
20
  gem.require_paths = ["lib"]
21
- gem.version = ProMotion::FORMOTION_VERSION
22
- gem.add_runtime_dependency("ProMotion", "~> 0.4.1")
23
- gem.add_runtime_dependency("formotion", "~> 1.1.4")
21
+ gem.version = ProMotion::Formotion::VERSION
22
+ gem.add_runtime_dependency("ProMotion", ">= 0.4.1")
23
+ gem.add_runtime_dependency("formotion", ">= 1.1.4")
24
24
  end
25
25
 
data/README.md CHANGED
@@ -1,4 +1,50 @@
1
- ProMotion-formotion
2
- ===================
1
+ # ProMotion-formotion
3
2
 
4
- ProMotion Formotion Screen
3
+ ProMotion Formotion Screen
4
+
5
+ Made a gem from the ProMotion formotion example at https://github.com/clearsightstudio/ProMotion#using-your-own-uiviewcontroller
6
+
7
+ ## Setup
8
+
9
+ Add this gem to your project, in Gemfile `gem 'ProMotion-formotion'`,
10
+ then `bundle update`
11
+
12
+ Create a Formotion Screen with:
13
+ ```ruby
14
+ class MyFormotionScreen < ProMotion::Formotion::FormotionScreen
15
+ title "Formotion Example"
16
+
17
+ def on_submit(_form)
18
+ # Submit pressed
19
+ if Data.saved?
20
+ close(saved: true)
21
+ end
22
+ end
23
+
24
+ def form_data
25
+ {
26
+ sections: [{
27
+ title: "Test",
28
+ rows: [{
29
+ title: "Name",
30
+ key: :name,
31
+ placeholder: "tag name",
32
+ type: :string,
33
+ auto_correction: :no,
34
+ auto_capitalization: :none
35
+ },
36
+ {
37
+ title: "Photo",
38
+ key: :photo,
39
+ placeholder: "photo name",
40
+ type: :image,
41
+ auto_correction: :no,
42
+ auto_capitalization: :none
43
+ },
44
+ ],
45
+ }]
46
+ }
47
+ end
48
+
49
+ end
50
+ ```
@@ -1,7 +1,8 @@
1
1
  module ProMotion
2
+ module Formotion
2
3
 
3
- class FormotionScreen < Formotion::FormController # Can also be < UIViewController
4
- include ProMotion::ScreenModule # Not TableScreenModule since we're using Formotion for that
4
+ class FormotionScreen < ::Formotion::FormController # Can also be < UIViewController
5
+ include ::ProMotion::ScreenModule # Not TableScreenModule since we're using Formotion for that
5
6
 
6
7
  # Required functions for ProMotion to work properly
7
8
 
@@ -10,7 +11,7 @@ class FormotionScreen < Formotion::FormController # Can also be < UIViewControll
10
11
  end
11
12
 
12
13
  def init_form
13
- @local_form=Formotion::Form.new(form_data)
14
+ @local_form=::Formotion::Form.new(form_data)
14
15
  if self.respond_to?(:on_submit)
15
16
  @local_form.on_submit do |form|
16
17
  self.on_submit(form.render)
@@ -67,4 +68,5 @@ class FormotionScreen < Formotion::FormController # Can also be < UIViewControll
67
68
  end
68
69
  end
69
70
 
70
- end
71
+ end
72
+ end
@@ -0,0 +1,5 @@
1
+ module ProMotion
2
+ module Formotion
3
+ VERSION = "0.0.6" unless defined?(ProMotion::Formotion::VERSION)
4
+ end
5
+ end
@@ -2,9 +2,8 @@ unless defined?(Motion::Project::Config)
2
2
  raise "This file must be required within a RubyMotion project Rakefile."
3
3
  end
4
4
 
5
- require "ProMotion/version-formotion"
5
+ require "ProMotion/formotion/version"
6
6
 
7
7
  Motion::Project::App.setup do |app|
8
8
  app.files = Dir.glob(File.join(File.dirname(__FILE__), 'ProMotion/**/*.rb')) | app.files
9
- p app.files
10
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ProMotion-formotion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-28 00:00:00.000000000 Z
12
+ date: 2013-03-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ProMotion
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: 0.4.1
22
22
  type: :runtime
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 0.4.1
30
30
  - !ruby/object:Gem::Dependency
@@ -32,7 +32,7 @@ dependencies:
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ~>
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
37
  version: 1.1.4
38
38
  type: :runtime
@@ -40,7 +40,7 @@ dependencies:
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ~>
43
+ - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: 1.1.4
46
46
  description: ProMotion-formotion bind ProMotion and formotion together.
@@ -57,8 +57,8 @@ files:
57
57
  - ProMotion-formotion.gemspec
58
58
  - README.md
59
59
  - lib/ProMotion-formotion.rb
60
- - lib/ProMotion/formotion_screen.rb
61
- - lib/ProMotion/version-formotion.rb
60
+ - lib/ProMotion/formotion/formotion_screen.rb
61
+ - lib/ProMotion/formotion/version.rb
62
62
  homepage: https://github.com/rheoli/ProMotion-formotion
63
63
  licenses: []
64
64
  post_install_message:
@@ -1,3 +0,0 @@
1
- module ProMotion
2
- FORMOTION_VERSION = "0.0.5" unless defined?(ProMotion::FORMOTION_VERSION)
3
- end