Class: Prick::Feature
- Inherits:
-
Branch
show all
- Defined in:
- lib/prick/branch.rb,
lib/prick/build.rb
Overview
Feature maintains a migration in the parent release but it is ignored when including the feature
Instance Attribute Summary collapse
Attributes inherited from Branch
#base_version, #directory, #migration, #name, #schema, #version
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Branch
#<=>, #build, #checkout_release, #dump, exist?, #exist?, #feature?, #migrate, #migrate_features, #migration?, #prepare, #prepared?, #prerelease?, #present?, present?, #release?
Constructor Details
#initialize(feature_name, base_version) ⇒ Feature
Returns a new instance of Feature.
325
326
327
328
329
330
331
|
# File 'lib/prick/build.rb', line 325
def initialize(project, base_release, name)
base_release.is_a?(Release) || base_release.is_a?(Prerelease) or
raise Internal, "Expected a Release object, got #{base_release.class}"
version = Version.new(base_release.version, feature: name)
migration = FeatureMigration.new(Migration.path(version))
super(project, base_release, version, migration)
end
|
Instance Attribute Details
#feature_name ⇒ Object
Returns the value of attribute feature_name.
204
205
206
|
# File 'lib/prick/branch.rb', line 204
def feature_name
@feature_name
end
|
Class Method Details
.directory(name) ⇒ Object
248
249
250
251
|
# File 'lib/prick/branch.rb', line 248
def self.directory(name)
version = Version.new(name)
File.join(Release.directory(version.truncate(:feature).to_s), version.feature.to_s)
end
|
.load(name) ⇒ Object
242
243
244
245
246
|
# File 'lib/prick/branch.rb', line 242
def self.load(name)
directory = self.directory(name)
migration_state = MigrationState.new(directory).read
self.new(migration_state.version.feature, migration_state.base_version)
end
|
Instance Method Details
#checkout ⇒ Object
333
334
335
336
|
# File 'lib/prick/build.rb', line 333
def checkout()
super
end
|
#create ⇒ Object
338
339
340
341
342
343
344
345
|
# File 'lib/prick/build.rb', line 338
def create
super
migration.create
migration.prepare
Git.commit("Created feature #{feature}")
migration.dump
self
end
|
#database ⇒ Object
206
|
# File 'lib/prick/branch.rb', line 206
def database() base_version.to_s end
|
#feature ⇒ Object
318
|
# File 'lib/prick/build.rb', line 318
def feature() version.feature end
|
#include(feature_version) ⇒ Object
222
|
# File 'lib/prick/branch.rb', line 222
def include(feature_version) @migration.insert_feature(feature_version) end
|
#node ⇒ Object
A feature’s node is the feature directory
321
|
# File 'lib/prick/build.rb', line 321
def node() release_dir end
|
#rebase(base_version) ⇒ Object
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
# File 'lib/prick/build.rb', line 360
def rebase(new_base_release)
end
|
#release_dir ⇒ Object
323
|
# File 'lib/prick/build.rb', line 323
def release_dir() migration.path end
|