annotate-sequel 1.0.0.final → 1.0.0.pre1

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ea02a9d3e5ef81c39076ca78c9c58faaada4058d
4
- data.tar.gz: 34d3cc76a52e0b73dd76d0956fff151366a2a206
3
+ metadata.gz: 40e34287e8ddeb904634468f842df53f292006c5
4
+ data.tar.gz: 9fcaebf24e412b3edc23d312341fd2112054ed22
5
5
  SHA512:
6
- metadata.gz: b1c089492de8c7d3ff2f78ffe3cee3ac81eb8b474b1fb20c8f549ce45d37c2095fd47a20c27d86845659df4c00a3d5f9fe46b209a18183f4b1da4ea293ff8f4a
7
- data.tar.gz: 333c77ebf71c69820ba8143b07f2124059d5e45b07832b08dcd4e41d50e1ed3cb46a326a801d8ca3422b1a532274d0ebbaf4b3d664bceef6c895266c7ef36eb7
6
+ metadata.gz: 31b2b5753e7ae9d8fd7568b9116a2df089e08ccd94c87d6d79b38142c2854ccdff0235ead3bf5b625689ee893489a71a58d68eccd32e768abd10a6d7313962d5
7
+ data.tar.gz: c67abb4188dda287d115575de90749b27f9e3cec067e8b6e18f8bebd59bd8dc6eac45bde2f918043a632ddde779168be3744d69b0428fb4ff33163aa8fcdc54d
data/README.rdoc CHANGED
@@ -2,50 +2,38 @@
2
2
 
3
3
  A gem to annotate your Sequel models.
4
4
 
5
- == DISCLAIMER: Not ready for production, yet
6
-
7
- Currently only tested for Rails 3 and only supports Sequel 3.x as of right now.
8
- Eventually this gem will support Sequel 4.
9
-
10
5
  == Example
11
6
 
12
7
  The schema comment looks like this:
13
8
 
14
- # Schema Info
15
- #
16
- # Table name: items
17
- #
18
- # id :integer, {:allow_null=>false, :default=>nil, :primary_key=>true, :db_type=>"integer", :ruby_default=>nil}
19
- # name :string, {:allow_null=>true, :default=>nil, :primary_key=>false, :db_type=>"varchar(255)", :ruby_default=>nil}
20
- # price :float, {:allow_null=>true, :default=>nil, :primary_key=>false, :db_type=>"double precision", :ruby_default=>nil}
21
- #
22
-
23
- DB.create_table :items do
24
- primary_key :id
25
- String :name
26
- Float :price
27
- end
28
-
29
- class Item < Sequel::Model(:items)
30
- end
9
+ # == Schema Info
10
+ #
11
+ # Table name: line_items
12
+ #
13
+ # id :integer(11) not null, primary key
14
+ # quantity :integer(11) not null
15
+ # product_id :integer(11) not null
16
+ # unit_price :float
17
+ # order_id :integer(11)
18
+ #
19
+
20
+ class LineItem < ActiveRecord::Base
21
+ belongs_to :product
22
+ . . .
31
23
 
32
24
  == Install
33
25
 
34
26
  For the `Gemfile`
35
27
 
36
- $ gem 'annotate-sequel'
28
+ gem 'annotate-sequel-models'
37
29
 
38
- == Usage
39
-
40
- In your Rails project run:
30
+ To install on your system
41
31
 
42
- $ annotate
32
+ gem install annotate-sequel-models
43
33
 
44
- That's it.
45
-
46
- == TODO
34
+ == Usage
47
35
 
48
- * Update models after migrations
36
+ rake annotate:sequel
49
37
 
50
38
  == Contributing to annotate-sequel
51
39
 
@@ -5,14 +5,13 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "annotate-sequel"
8
- s.version = "1.0.0.final"
8
+ s.version = "1.0.0.pre1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kenny Meyer"]
12
- s.date = "2013-11-14"
12
+ s.date = "2013-11-10"
13
13
  s.description = "Annotate Sequel models"
14
14
  s.email = "kenny@kennymeyer.net"
15
- s.executables = ["annotate"]
16
15
  s.extra_rdoc_files = [
17
16
  "LICENSE.txt",
18
17
  "README.rdoc"
@@ -26,10 +25,8 @@ Gem::Specification.new do |s|
26
25
  "README.rdoc",
27
26
  "Rakefile",
28
27
  "annotate-sequel.gemspec",
29
- "bin/annotate",
30
28
  "lib/annotate-sequel.rb",
31
29
  "lib/annotate_sequel/model.rb",
32
- "lib/annotate_sequel/tasks.rb",
33
30
  "lib/annotate_sequel/version.rb",
34
31
  "lib/tasks/annotate_sequel.rake",
35
32
  "spec/annotate-sequel_spec.rb",
@@ -1,23 +1,6 @@
1
1
  $:.unshift(File.dirname(__FILE__))
2
2
 
3
- require 'annotate_sequel/version'
4
- require 'annotate_sequel/model'
5
-
6
- module Annotate
7
- def self.loaded_tasks=(val); @loaded_tasks = val; end
8
- def self.loaded_tasks; return @loaded_tasks; end
9
-
10
- def self.load_tasks
11
- return if(self.loaded_tasks)
12
- self.loaded_tasks = true
13
- Dir[File.join(File.dirname(__FILE__), 'tasks', '**/*.rake')].each { |rake| load rake }
14
- end
15
-
16
- def self.bootstrap_rake
17
- if File.exists?("./Rakefile")
18
- load "./Rakefile"
19
- end
20
- Rake::Task[:environment].invoke rescue nil
21
- self.load_tasks
22
- end
3
+ class AnnotateSequel
4
+ require 'annotate_sequel/version'
5
+ require 'annotate_sequel/model'
23
6
  end
@@ -39,7 +39,6 @@ class AnnotateSequel
39
39
  end
40
40
 
41
41
  def get_model_class(file)
42
- require File.expand_path("#{model_dir}/#{file}")
43
42
  model_path = file.gsub(/\.rb$/, '')
44
43
  get_loaded_model(model_path) || get_loaded_model(model_path.split("/").last)
45
44
  end
@@ -50,8 +49,7 @@ class AnnotateSequel
50
49
  Class === c and
51
50
  c.ancestors.respond_to?(:include?) and
52
51
  c.ancestors.include?(Sequel::Model)
53
- end.
54
- detect { |c| underscore(c.name) == model_path }
52
+ end
55
53
  end
56
54
 
57
55
  def annotate_model_file(annotated, file)
@@ -3,7 +3,7 @@ class AnnotateSequel
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
5
  PATCH = 0
6
- BUILD = 'final'
6
+ BUILD = 'pre1'
7
7
 
8
8
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: annotate-sequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.final
4
+ version: 1.0.0.pre1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenny Meyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-14 00:00:00.000000000 Z
11
+ date: 2013-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -124,8 +124,7 @@ dependencies:
124
124
  version: '0'
125
125
  description: Annotate Sequel models
126
126
  email: kenny@kennymeyer.net
127
- executables:
128
- - annotate
127
+ executables: []
129
128
  extensions: []
130
129
  extra_rdoc_files:
131
130
  - LICENSE.txt
@@ -139,10 +138,8 @@ files:
139
138
  - README.rdoc
140
139
  - Rakefile
141
140
  - annotate-sequel.gemspec
142
- - bin/annotate
143
141
  - lib/annotate-sequel.rb
144
142
  - lib/annotate_sequel/model.rb
145
- - lib/annotate_sequel/tasks.rb
146
143
  - lib/annotate_sequel/version.rb
147
144
  - lib/tasks/annotate_sequel.rake
148
145
  - spec/annotate-sequel_spec.rb
data/bin/annotate DELETED
@@ -1,20 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require 'rubygems'
3
- require 'annotate-sequel'
4
- begin
5
- require 'bundler'
6
- Bundler.setup
7
- rescue Exception => e
8
- puts e.backtrace
9
- end
10
-
11
- here = File.expand_path(File.dirname __FILE__)
12
- $:<< "#{here}/../lib"
13
-
14
- require File.expand_path('config/environment')
15
- target = {
16
- :klass => AnnotateSequel::Model,
17
- :task => :do_annotations,
18
- }
19
-
20
- target[:klass].send(target[:task])
@@ -1,6 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
-
4
- # Make tasks visible for Rails also when used as gem.
5
- Dir[File.join(File.dirname(__FILE__), '..', 'tasks', '**/*.rake')].each { |rake| load rake }
6
- Dir[File.join(File.dirname(__FILE__), '..', '..', 'tasks', '**/*.rake')].each { |rake| load rake }