Class: Prick::Release
- Inherits:
-
AbstractRelease
- Object
- Build
- AbstractRelease
- Prick::Release
- Defined in:
- lib/prick/build.rb
Instance Attribute Summary
Attributes inherited from AbstractRelease
Attributes inherited from Build
#database, #migration, #project, #schema, #version
Instance Method Summary collapse
-
#create ⇒ Object
Create the release in Git and on the disk.
-
#initialize(project, base_release, version) ⇒ Release
constructor
A new instance of Release.
- #release_dir ⇒ Object
Methods inherited from AbstractRelease
#<=>, #cache, #cached?, #dump, #load, #loaded?, #prepare, #tag, #uncache, #unload
Methods inherited from Build
#<=>, #active?, #base_release, #build, #built?, #checkback, #checkout, deref_node_file, #destroy, #exist?, #features, #history, #include_feature, #name, #node, #present?, #rebuild, #remove_feature, #snapshot, #to_s
Methods included from Ensure
#ensure_state, #ensure_state_value, #revoke_state
Constructor Details
#initialize(project, base_release, version) ⇒ Release
Returns a new instance of Release.
240 241 242 243 |
# File 'lib/prick/build.rb', line 240 def initialize(project, base_release, version) migration = base_release && ReleaseMigration.new(base_release.release_dir) super(project, base_release, version, migration) end |
Instance Method Details
#create ⇒ Object
Create the release in Git and on the disk. We assume that the migration exists
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/prick/build.rb', line 246 def create super # Create migration link file if !version.zero? migration_version = "#{base_release.version}_#{version}" features = "../#{migration.path}" Dir.chdir(MIGRATION_DIR) { FileUtils.ln_s(features, migration_version) Git.add(migration_version) } end # Create new empty feature directory ReleaseMigration.new(release_dir).create Git.commit("Release #{version}") Git.create_tag(version) dump migration.dump if migration self end |
#release_dir ⇒ Object
238 |
# File 'lib/prick/build.rb', line 238 def release_dir() File.join(FEATURE_DIR, name) end |