motion-sqlite3 0.5.1 → 0.5.2

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: 69c11ae39a27fe5ca7b2bb6365e464a661fba96e
4
- data.tar.gz: 4548214b6206147f2ddb069bd36b3eba6afa02b1
3
+ metadata.gz: d329d5a42393437772f5c9ee8088fef09477c858
4
+ data.tar.gz: e87168233adef2a754d1b1a9e317a155288a9412
5
5
  SHA512:
6
- metadata.gz: 13e8288e59470b914ff988da4424f42c29e6a13bb8c13608f216296657122c8c0812e763f1f15044cf202c333a9938741bf866fc045b18215b2a42e4ba49d37b
7
- data.tar.gz: 66c9f6e74c7c7955f5feb7ab6c8580f7cc12607aa7834b980f652624fc834fa1822e5021246e05ec5975d5bf1e5365237501876fbcb7a0506a0f832e653b1085
6
+ metadata.gz: 0e3f733abdb0b23b3bc370043d67269d449136905f1ac8c34d617849ed689c42b813bfc80191229195f1ad79337f475fc3ac83bc9351934cd670f766059868fd
7
+ data.tar.gz: 80337a1f5293b53b72d2d9ffafbd2377c516b57767f8304fe0da70d41425aca03428e0cdd2831ddc82a7a6711a163436168717447fac4a8418a98f0aa436fef8
@@ -15,41 +15,29 @@ module SQLite3
15
15
 
16
16
  private
17
17
 
18
- def columns
19
- columns = {}
18
+ def current_row
19
+ row = {}
20
20
 
21
- count = sqlite3_column_count(@handle.value)
22
- 0.upto(count-1) do |i|
21
+ column_count = sqlite3_column_count(@handle.value)
22
+ 0.upto(column_count - 1) do |i|
23
23
  name = sqlite3_column_name(@handle.value, i).to_sym
24
24
  type = sqlite3_column_type(@handle.value, i)
25
25
 
26
- columns[name] = ColumnMetadata.new(i, type)
27
- end
28
-
29
- columns
30
- end
31
-
32
- def current_row
33
- row = {}
34
-
35
- columns.each do |name, metadata|
36
- case metadata.type
26
+ case type
37
27
  when SQLITE_NULL
38
28
  row[name] = nil
39
29
  when SQLITE_TEXT
40
- row[name] = sqlite3_column_text(@handle.value, metadata.index)
30
+ row[name] = sqlite3_column_text(@handle.value, i)
41
31
  when SQLITE_BLOB
42
- row[name] = NSData.dataWithBytes(sqlite3_column_blob(@handle.value, metadata.index), length: sqlite3_column_bytes(@handle.value, metadata.index))
32
+ row[name] = NSData.dataWithBytes(sqlite3_column_blob(@handle.value, i), length: sqlite3_column_bytes(@handle.value, i))
43
33
  when SQLITE_INTEGER
44
- row[name] = sqlite3_column_int(@handle.value, metadata.index)
34
+ row[name] = sqlite3_column_int(@handle.value, i)
45
35
  when SQLITE_FLOAT
46
- row[name] = sqlite3_column_double(@handle.value, metadata.index)
36
+ row[name] = sqlite3_column_double(@handle.value, i)
47
37
  end
48
38
  end
49
39
 
50
40
  row
51
41
  end
52
42
  end
53
-
54
- class ColumnMetadata < Struct.new(:index, :type); end
55
43
  end
@@ -1,3 +1,3 @@
1
1
  module SQLite3
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -16,5 +16,5 @@ Gem::Specification.new do |gem|
16
16
  gem.version = SQLite3::VERSION
17
17
 
18
18
  gem.add_development_dependency 'rake'
19
- gem.add_dependency 'motion.h', '~> 0.0.3'
19
+ gem.add_dependency 'motion.h', '~> 0.0.4'
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-sqlite3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Green
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-21 00:00:00.000000000 Z
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.0.3
33
+ version: 0.0.4
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.0.3
40
+ version: 0.0.4
41
41
  description: A minimal wrapper over the SQLite 3 C API for RubyMotion
42
42
  email:
43
43
  - mattgreenrocks@gmail.com