sequel_column_type_array 0.0.2 → 0.0.3

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.
data/.gitignore CHANGED
@@ -1,22 +1,4 @@
1
- ## MAC OS
2
- .DS_Store
3
-
4
- ## TEXTMATE
5
- *.tmproj
6
- tmtags
7
-
8
- ## EMACS
9
- *~
10
- \#*
11
- .\#*
12
-
13
- ## VIM
14
- *.swp
15
-
16
- ## PROJECT::GENERAL
17
- coverage
18
- rdoc
19
- pkg
20
- nbproject
21
-
22
- ## PROJECT::SPECIFIC
1
+ *.gem
2
+ .bundle
3
+ Gemfile.lock
4
+ pkg/*
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in sequel_column_type_array.gemspec
4
+ gemspec
data/Rakefile CHANGED
@@ -1,46 +1 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- begin
5
- require 'jeweler'
6
- Jeweler::Tasks.new do |gem|
7
- gem.name = 'sequel_column_type_array'
8
- gem.authors = ['Corin Langosch']
9
- gem.date = Date.today.to_s
10
- gem.email = 'info@netskin.com'
11
- gem.homepage = 'http://github.com/gucki/sequel_column_type_array'
12
- gem.summary = 'Allow easy use of array column types with databases that support them'
13
- gem.description = 'Handles the typecasting of array columns so they can be used as any other datatype.'
14
- gem.add_development_dependency "rspec", ">= 1.2.9"
15
- # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
- end
17
- Jeweler::GemcutterTasks.new
18
- rescue LoadError
19
- puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
20
- end
21
-
22
- require 'spec/rake/spectask'
23
- Spec::Rake::SpecTask.new(:spec) do |spec|
24
- spec.libs << 'lib' << 'spec'
25
- spec.spec_files = FileList['spec/**/*_spec.rb']
26
- end
27
-
28
- Spec::Rake::SpecTask.new(:rcov) do |spec|
29
- spec.libs << 'lib' << 'spec'
30
- spec.pattern = 'spec/**/*_spec.rb'
31
- spec.rcov = true
32
- end
33
-
34
- task :spec => :check_dependencies
35
-
36
- task :default => :spec
37
-
38
- require 'rake/rdoctask'
39
- Rake::RDocTask.new do |rdoc|
40
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
41
-
42
- rdoc.rdoc_dir = 'rdoc'
43
- rdoc.title = "sequel_column_type_array #{version}"
44
- rdoc.rdoc_files.include('README*')
45
- rdoc.rdoc_files.include('lib/**/*.rb')
46
- end
1
+ require "bundler/gem_tasks"
@@ -1,11 +1,10 @@
1
1
  module Sequel
2
-
3
2
  class ColumnArray < Array
4
3
  def normalize(data)
5
4
  case data
6
5
  when String
7
6
  csv = data[1..-2]
8
- csv.blank? ? [] : csv.parse_csv
7
+ (csv.nil? || csv.empty?) ? [] : csv.parse_csv
9
8
  when Array
10
9
  data
11
10
  else
@@ -6,6 +6,12 @@ module Sequel
6
6
  PG_TYPES[1014] = lambda{ |s| StringColumnArray.new(s) } # character[]
7
7
  PG_TYPES[1015] = PG_TYPES[1014] # character varying[]
8
8
 
9
+ class Dataset < Sequel::Dataset
10
+ def literal_array_append(sql, v)
11
+ sql << literal_array(v)
12
+ end
13
+ end
14
+
9
15
  module DatabaseMethods
10
16
  def schema_column_type(db_type)
11
17
  type = super(db_type)
@@ -0,0 +1,3 @@
1
+ module SequelColumnTypeArray
2
+ VERSION = "0.0.3"
3
+ end
@@ -1,6 +1,11 @@
1
1
  require "sequel"
2
2
  require "csv"
3
3
 
4
+ require "sequel_column_type_array/version"
4
5
  require "sequel_column_type_array/column_types"
5
6
  require "sequel_column_type_array/dataset"
6
7
  require "sequel_column_type_array/postgres"
8
+
9
+ module SequelColumnTypeArray
10
+ end
11
+
@@ -1,58 +1,25 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
1
  # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "sequel_column_type_array/version"
5
4
 
6
5
  Gem::Specification.new do |s|
7
- s.name = %q{sequel_column_type_array}
8
- s.version = "0.0.2"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Corin Langosch"]
12
- s.date = %q{2010-09-30}
6
+ s.name = "sequel_column_type_array"
7
+ s.version = SequelColumnTypeArray::VERSION
8
+ s.authors = ["Corin Langosch"]
9
+ s.email = ["info@corinlangosch.com"]
10
+ s.homepage = "https://github.com/gucki/sequel_column_type_array"
11
+ s.summary = %q{Allow easy use of array column types with databases that support them}
13
12
  s.description = %q{Handles the typecasting of array columns so they can be used as any other datatype.}
14
- s.email = %q{info@netskin.com}
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.rdoc"
18
- ]
19
- s.files = [
20
- ".document",
21
- ".gitignore",
22
- "LICENSE",
23
- "README.rdoc",
24
- "Rakefile",
25
- "VERSION",
26
- "lib/sequel_column_type_array.rb",
27
- "lib/sequel_column_type_array/column_types.rb",
28
- "lib/sequel_column_type_array/dataset.rb",
29
- "lib/sequel_column_type_array/postgres.rb",
30
- "sequel_column_type_array.gemspec",
31
- "spec/sequel_colum_type_array.rb",
32
- "spec/spec.opts",
33
- "spec/spec_helper.rb"
34
- ]
35
- s.homepage = %q{http://github.com/gucki/sequel_column_type_array}
36
- s.rdoc_options = ["--charset=UTF-8"]
37
- s.require_paths = ["lib"]
38
- s.rubygems_version = %q{1.3.7}
39
- s.summary = %q{Allow easy use of array column types with databases that support them}
40
- s.test_files = [
41
- "spec/spec_helper.rb",
42
- "spec/sequel_colum_type_array.rb"
43
- ]
44
13
 
45
- if s.respond_to? :specification_version then
46
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
47
- s.specification_version = 3
14
+ s.rubyforge_project = "sequel_column_type_array"
15
+
16
+ s.files = `git ls-files`.split("\n")
17
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
+ s.require_paths = ["lib"]
48
20
 
49
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
- s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
51
- else
52
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
53
- end
54
- else
55
- s.add_dependency(%q<rspec>, [">= 1.2.9"])
56
- end
21
+ # specify any dependencies here; for example:
22
+ # s.add_development_dependency "rspec"
23
+ # s.add_runtime_dependency "rest-client"
57
24
  end
58
25
 
metadata CHANGED
@@ -1,93 +1,57 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sequel_column_type_array
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 2
9
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.3
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Corin Langosch
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2010-09-30 00:00:00 +01:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: rspec
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 1
30
- - 2
31
- - 9
32
- version: 1.2.9
33
- type: :development
34
- version_requirements: *id001
35
- description: Handles the typecasting of array columns so they can be used as any other datatype.
36
- email: info@netskin.com
12
+ date: 2012-01-17 00:00:00.000000000 Z
13
+ dependencies: []
14
+ description: Handles the typecasting of array columns so they can be used as any other
15
+ datatype.
16
+ email:
17
+ - info@corinlangosch.com
37
18
  executables: []
38
-
39
19
  extensions: []
40
-
41
- extra_rdoc_files:
42
- - LICENSE
43
- - README.rdoc
44
- files:
45
- - .document
20
+ extra_rdoc_files: []
21
+ files:
46
22
  - .gitignore
23
+ - Gemfile
47
24
  - LICENSE
48
25
  - README.rdoc
49
26
  - Rakefile
50
- - VERSION
51
27
  - lib/sequel_column_type_array.rb
52
28
  - lib/sequel_column_type_array/column_types.rb
53
29
  - lib/sequel_column_type_array/dataset.rb
54
30
  - lib/sequel_column_type_array/postgres.rb
31
+ - lib/sequel_column_type_array/version.rb
55
32
  - sequel_column_type_array.gemspec
56
- - spec/sequel_colum_type_array.rb
57
- - spec/spec.opts
58
- - spec/spec_helper.rb
59
- has_rdoc: true
60
- homepage: http://github.com/gucki/sequel_column_type_array
33
+ homepage: https://github.com/gucki/sequel_column_type_array
61
34
  licenses: []
62
-
63
35
  post_install_message:
64
- rdoc_options:
65
- - --charset=UTF-8
66
- require_paths:
36
+ rdoc_options: []
37
+ require_paths:
67
38
  - lib
68
- required_ruby_version: !ruby/object:Gem::Requirement
39
+ required_ruby_version: !ruby/object:Gem::Requirement
69
40
  none: false
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- segments:
74
- - 0
75
- version: "0"
76
- required_rubygems_version: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
46
  none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- segments:
82
- - 0
83
- version: "0"
47
+ requirements:
48
+ - - ! '>='
49
+ - !ruby/object:Gem::Version
50
+ version: '0'
84
51
  requirements: []
85
-
86
- rubyforge_project:
87
- rubygems_version: 1.3.7
52
+ rubyforge_project: sequel_column_type_array
53
+ rubygems_version: 1.8.10
88
54
  signing_key:
89
55
  specification_version: 3
90
56
  summary: Allow easy use of array column types with databases that support them
91
- test_files:
92
- - spec/spec_helper.rb
93
- - spec/sequel_colum_type_array.rb
57
+ test_files: []
data/.document DELETED
@@ -1,5 +0,0 @@
1
- README.rdoc
2
- lib/**/*.rb
3
- bin/*
4
- features/**/*.feature
5
- LICENSE
data/VERSION DELETED
@@ -1 +0,0 @@
1
- 0.0.2
@@ -1,7 +0,0 @@
1
- require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
-
3
- describe "SequelColumnTypeArray" do
4
- it "fails" do
5
- fail "hey buddy, you should probably rename this file and start specing for real"
6
- end
7
- end
data/spec/spec.opts DELETED
@@ -1 +0,0 @@
1
- --color
data/spec/spec_helper.rb DELETED
@@ -1,9 +0,0 @@
1
- $LOAD_PATH.unshift(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- require 'sequel_column_type_array'
4
- require 'spec'
5
- require 'spec/autorun'
6
-
7
- Spec::Runner.configure do |config|
8
-
9
- end