annotate-sequel 1.0.0.pre3 → 1.0.0

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: 545d296445a3fad58b153ede8c76b5c257424a9b
4
- data.tar.gz: 48098e18043694db3ef384b2b3261f4b4cbdc73b
3
+ metadata.gz: a748fcba7330354fc2d27efecb7f61e19045feca
4
+ data.tar.gz: 6396b5ce769891e3e7b0187019ccdd9ef45bab42
5
5
  SHA512:
6
- metadata.gz: 4e287d306670a14b652e0ba9c72d2e817e01afe17a6b1bb9b2baebdb0e5f3eb6bef46903649c3c23797723f01351c6d4a5ea9d582663f19259ff7286b21326e5
7
- data.tar.gz: 7c6f5ac1c5597aad4dc005c7a2bc93418157b564c45d9caf1c4778de552b698c0b5e665fbdc64c55c8f8c751b66b3db486544dd5ef70aa8496904212e07bccc2
6
+ metadata.gz: ba6e2ed1445d9e7d4b2efc250c677770c8f9b51c4727f36b3cfce9c11392ec25c206084c827a1d14165589d751724515afdefed8ee39bc28a2ff43d87448b360
7
+ data.tar.gz: 4dc8e0e5e2c279fb746b4ee7909c7c3aa64b42ae5e0dc4a84a210665090d464cbd24bbb53965c196b22c1f92482c689faeb3e77b30f836ab6a8b8974a2891fce
data/README.rdoc CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  A gem to annotate your Sequel models.
4
4
 
5
+ Currently only tested for Rails 3 and only supports Sequel 3.x as of right now.
6
+ Eventually this gem will support Sequel 4.
7
+
5
8
  == Example
6
9
 
7
10
  The schema comment looks like this:
@@ -30,14 +33,18 @@ For the `Gemfile`
30
33
 
31
34
  $ gem 'annotate-sequel'
32
35
 
33
- To install on your system
34
-
35
- $ gem install annotate-sequel
36
-
37
36
  == Usage
38
37
 
38
+ In your Rails project run:
39
+
39
40
  $ annotate
40
41
 
42
+ That's it.
43
+
44
+ == TODO
45
+
46
+ * Update models after migrations
47
+
41
48
  == Contributing to annotate-sequel
42
49
 
43
50
  * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "annotate-sequel"
8
- s.version = "1.0.0.pre3"
8
+ s.version = "1.0.0"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kenny Meyer"]
12
- s.date = "2013-11-10"
12
+ s.date = "2013-11-14"
13
13
  s.description = "Annotate Sequel models"
14
14
  s.email = "kenny@kennymeyer.net"
15
15
  s.executables = ["annotate"]
data/bin/annotate CHANGED
@@ -11,10 +11,10 @@ end
11
11
  here = File.expand_path(File.dirname __FILE__)
12
12
  $:<< "#{here}/../lib"
13
13
 
14
+ require File.expand_path('config/environment')
14
15
  target = {
15
16
  :klass => AnnotateSequel::Model,
16
17
  :task => :do_annotations,
17
18
  }
18
19
 
19
- Annotate.eager_load(options)
20
20
  target[:klass].send(target[:task])
@@ -20,9 +20,4 @@ module Annotate
20
20
  Rake::Task[:environment].invoke rescue nil
21
21
  self.load_tasks
22
22
  end
23
-
24
- def self.eager_load
25
- klass = Rails::Application.send(:subclasses).first
26
- klass.eager_load!
27
- end
28
23
  end
@@ -39,6 +39,7 @@ class AnnotateSequel
39
39
  end
40
40
 
41
41
  def get_model_class(file)
42
+ require File.expand_path("#{model_dir}/#{file}")
42
43
  model_path = file.gsub(/\.rb$/, '')
43
44
  get_loaded_model(model_path) || get_loaded_model(model_path.split("/").last)
44
45
  end
@@ -49,7 +50,8 @@ class AnnotateSequel
49
50
  Class === c and
50
51
  c.ancestors.respond_to?(:include?) and
51
52
  c.ancestors.include?(Sequel::Model)
52
- end
53
+ end.
54
+ detect { |c| underscore(c.name) == model_path }
53
55
  end
54
56
 
55
57
  def annotate_model_file(annotated, file)
@@ -3,8 +3,8 @@ class AnnotateSequel
3
3
  MAJOR = 1
4
4
  MINOR = 0
5
5
  PATCH = 0
6
- BUILD = 'pre3'
6
+ BUILD = 'final'
7
7
 
8
- STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
8
+ STRING = [MAJOR, MINOR, PATCH].compact.join('.')
9
9
  end
10
10
  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.pre3
4
+ version: 1.0.0
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-10 00:00:00.000000000 Z
11
+ date: 2013-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel
@@ -163,9 +163,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
163
  version: '0'
164
164
  required_rubygems_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - '>'
166
+ - - '>='
167
167
  - !ruby/object:Gem::Version
168
- version: 1.3.1
168
+ version: '0'
169
169
  requirements: []
170
170
  rubyforge_project:
171
171
  rubygems_version: 2.0.6