Module: Pluto
- Defined in:
- lib/pluto/models.rb,
lib/pluto/schema.rb,
lib/pluto/version.rb,
lib/pluto/connecter.rb,
lib/pluto/models/feed.rb,
lib/pluto/models/item.rb,
lib/pluto/models/site.rb,
lib/pluto/models/utils.rb,
lib/pluto/models/forward.rb,
lib/pluto/models/subscription.rb
Defined Under Namespace
Modules: Model
Classes: Connecter, CreateDb
Constant Summary
collapse
- MAJOR =
1
- MINOR =
5
- PATCH =
0
- VERSION =
[MAJOR,MINOR,PATCH].join('.')
- Models =
note: convenience alias for Model lets you use include Pluto::Models
Model
Class Method Summary
collapse
Class Method Details
.auto_migrate! ⇒ Object
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
# File 'lib/pluto/models.rb', line 64
def self.auto_migrate!
unless LogDb::Model::Log.table_exists?
LogDb.create end
unless ConfDb::Model::Prop.table_exists?
ConfDb.create end
unless ActivityDb::Models::Activity.table_exists?
ActivityDb::CreateDb.new.up end
unless Model::Feed.table_exists?
Pluto.create
end
end
|
.banner ⇒ Object
14
15
16
17
|
# File 'lib/pluto/version.rb', line 14
def self.banner
"pluto-models/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end
|
.connect(config = {}) ⇒ Object
convenience shortcut without (w/o) automigrate
86
87
88
|
# File 'lib/pluto/models.rb', line 86
def self.connect( config={} ) Connecter.new.connect( config )
end
|
.connect!(config = {}) ⇒ Object
convenience shortcut w/ automigrate
.create ⇒ Object
51
52
53
54
|
# File 'lib/pluto/models.rb', line 51
def self.create
CreateDb.new.up
ConfDb::Model::Prop.create!( key: 'db.schema.planet.version', value: VERSION )
end
|
.create_all ⇒ Object
56
57
58
59
60
61
|
# File 'lib/pluto/models.rb', line 56
def self.create_all
LogDb.create ConfDb.create ActivityDb::CreateDb.new.up Pluto.create
end
|
.generator ⇒ Object
Note: moved from pluto-merge (add here because pluto-merge gem is optional)
fix: remove generator in pluto-merge!!! (duplicate)
21
22
23
|
# File 'lib/pluto/version.rb', line 21
def self.generator "Pluto #{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]"
end
|
.root ⇒ Object
26
27
28
|
# File 'lib/pluto/version.rb', line 26
def self.root
"#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
end
|
.setup_in_memory_db ⇒ Object
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/pluto/models.rb', line 96
def self.setup_in_memory_db
ActiveRecord::Base.logger = Logger.new( STDOUT )
Pluto.connect( adapter: 'sqlite3',
database: ':memory:' )
Pluto.create_all
end
|
.version ⇒ Object
10
11
12
|
# File 'lib/pluto/version.rb', line 10
def self.version
VERSION
end
|