Class: MetaCommit::ApplicationInterface
- Inherits:
-
Thor
- Object
- Thor
- MetaCommit::ApplicationInterface
- Defined in:
- lib/meta_commit/cli.rb
Instance Method Summary collapse
Instance Method Details
#changelog(from_tag = nil, to_tag = nil) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/meta_commit/cli.rb', line 29 def changelog(from_tag=nil, to_tag=nil) repository_path = [:directory] filename = [:filename] repository = MetaCommit::Git::Repo.new(repository_path) from_tag_commit = repository.commit_of_tag(from_tag) to_tag_commit = repository.commit_of_tag(to_tag) container = boot_container_with_config(File.join(repository_path, MetaCommit::ConfigurationStore::META_COMMIT_CONFIG_FILENAME)) examiner = MetaCommit::Changelog::Commands::CommitDiffExaminer.new( container.resolve(:parse_command), container.resolve(:contextual_ast_node_factory), container.resolve(:diff_factory) ) = examiner.(repository, from_tag_commit, to_tag_commit) adapter = MetaCommit::Changelog::Adapters::Changelog.new(repository.dir, filename, to_tag, to_tag_commit.time.strftime('%Y-%m-%d')) change_saver = MetaCommit::Services::ChangeSaver.new(repository, adapter) change_saver.() say("added version [#{to_tag}] to #{filename}") end |
#index ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/meta_commit/cli.rb', line 54 def index repository_path = [:directory] repository = MetaCommit::Git::Repo.new(repository_path) container = boot_container_with_config(File.join(repository_path, MetaCommit::ConfigurationStore::META_COMMIT_CONFIG_FILENAME)) examiner = MetaCommit::Index::Commands::DiffExaminer.new( container.resolve(:parse_command), container.resolve(:contextual_ast_node_factory), container.resolve(:diff_factory) ) = examiner.(repository) adapter = MetaCommit::Index::Adapters::GitNotes.new(repository.path) change_saver = MetaCommit::Services::ChangeSaver.new(repository, adapter) change_saver.() say('repository successfully indexed') end |
#message ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/meta_commit/cli.rb', line 9 def repository_path = [:directory] repository = MetaCommit::Git::Repo.new(repository_path) container = boot_container_with_config(File.join(repository_path, MetaCommit::ConfigurationStore::META_COMMIT_CONFIG_FILENAME)) examiner = MetaCommit::Message::Commands::DiffIndexExaminer.new( container.resolve(:parse_command), container.resolve(:contextual_ast_node_factory), container.resolve(:diff_factory) ) = examiner.(repository) say(MetaCommit::Message::Formatters::CommitMessageBuilder.new.build()) end |