motion-table 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -21,10 +21,6 @@ Alternatively, get the edge version:
21
21
 
22
22
  gem 'motion-table', :git => 'git@github.com:clearsightstudio/motion-table.git'
23
23
 
24
- ## Please Note
25
-
26
- We only have GroupedTables implemented at this point. We will be adding functionality, but if you need something else, fork it, add it and submit a pull request.
27
-
28
24
  ## Usage
29
25
 
30
26
  Include MotionTable in your controller and handle UITableViews Easily
@@ -99,7 +95,7 @@ class MyController < UITableViewController
99
95
  # load this friend based on id
100
96
  end
101
97
 
102
- def somethind_here(args)
98
+ def something_here(args)
103
99
  # You can pass any data structure into :arguments, it is just passed as an argument to your implementation
104
100
  # You have to handle it. Like so:
105
101
  args.each do |k, v|
@@ -1,4 +1,7 @@
1
1
  module MotionTable
2
+ # @author Silas J Matson
3
+ #
4
+ # Provides coloring for displaying messages in console when running in the simulator
2
5
  class Console
3
6
  NAME = "MotionTable::Console"
4
7
  DEFAULT_COLOR = [ '', '' ]
@@ -1,17 +1,16 @@
1
1
  module MotionTable
2
2
  module SectionedTable
3
-
4
- def self.included(base)
5
- base.send :extend, MotionTable::SectionedTable
6
- end
7
-
3
+ # Likely the only method you need call from the controller
4
+ # @param [Array] Array of table data
5
+ # @returns [UITableView] delegated to self
8
6
  def createTableViewFromData(data)
9
7
  @mt_table_view_groups = data
10
8
  return tableView
11
9
  end
12
10
 
13
11
  def numberOfSectionsInTableView(tableView)
14
- return @mt_table_view_groups.length
12
+ return @mt_table_view_groups.length if @mt_table_view_groups
13
+ 0
15
14
  end
16
15
 
17
16
  # Number of cells
@@ -46,10 +45,13 @@ module MotionTable
46
45
  cell = cellAtSectionAndIndex(indexPath.section, indexPath.row)
47
46
  tableView.deselectRowAtIndexPath(indexPath, animated: true);
48
47
  if self.respond_to?(cell[:action])
49
- if cell[:arguments]
50
- self.send(cell[:action], cell[:arguments])
51
- else
48
+ expectedArguments = self.method(cell[:action]).arity
49
+ if expectedArguments == 0
50
+ self.send(cell[:action])
51
+ elsif expectedArguments == 1
52
52
  self.send(cell[:action], cell[:arguments])
53
+ else
54
+ MotionTable::Console.log("MotionTable warning: #{cell[:action]} expects #{expectedArguments} arguments. Maximum number of required arguments for an action is 1.", withColor: MotionTable::Console::RED_COLOR)
53
55
  end
54
56
  else
55
57
  MotionTable::Console.log(self, actionNotImplemented: cell[:action])
@@ -1,3 +1,3 @@
1
1
  module MotionTable
2
- VERSION = "0.1.4" unless defined?(MotionTable::VERSION)
2
+ VERSION = "0.1.5" unless defined?(MotionTable::VERSION)
3
3
  end
data/motion-table.gemspec CHANGED
@@ -4,8 +4,8 @@ require File.expand_path('../lib/motion-table/version', __FILE__)
4
4
  Gem::Specification.new do |gem|
5
5
  gem.authors = ["ClearSight Studio"]
6
6
  gem.email = ["contact@clearsightstudio.com"]
7
- gem.description = "MotionTable is a RubyMotion gem that makes it easy to handle UITableViews from a UITableViewController."
8
- gem.summary = "MotionTable is a RubyMotion gem that makes it easy to handle UITableViews from a UITableViewController. Simply include in the module in your controller."
7
+ gem.description = "MotionTable is a RubyMotion gem that makes it easy to handle UITableViews from a UITableViewController. Simply include in the module in your controller."
8
+ gem.summary = "MotionTable is a RubyMotion gem that makes it easy to handle UITableViews from a UITableViewController."
9
9
  gem.homepage = "https://github.com/clearsightstudio/motion-table"
10
10
 
11
11
  gem.files = `git ls-files`.split($\)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-table
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,10 +9,10 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-28 00:00:00.000000000 Z
12
+ date: 2012-08-29 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: MotionTable is a RubyMotion gem that makes it easy to handle UITableViews
15
- from a UITableViewController.
15
+ from a UITableViewController. Simply include in the module in your controller.
16
16
  email:
17
17
  - contact@clearsightstudio.com
18
18
  executables: []
@@ -58,7 +58,7 @@ rubygems_version: 1.8.22
58
58
  signing_key:
59
59
  specification_version: 3
60
60
  summary: MotionTable is a RubyMotion gem that makes it easy to handle UITableViews
61
- from a UITableViewController. Simply include in the module in your controller.
61
+ from a UITableViewController.
62
62
  test_files:
63
63
  - spec/console_spec.rb
64
64
  - spec/grouped_table_spec.rb