takelage 0.20.1 → 0.20.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d318a7c4c17c6319e50997f41934e44a39fb6fddd58c66f8f1da168a5e21d54
4
- data.tar.gz: f56501c87c2044f41e9b7f66473aeb3c1244a1b6ec983b4853d7e2565b65f4e4
3
+ metadata.gz: 2f755a130345b2343101f6ad38a711d11b8d15413506465534737b09ddd0459f
4
+ data.tar.gz: 75fd7eb711147a14896a635751e0d544fc57e490b11546d90cb82ce1858aec43
5
5
  SHA512:
6
- metadata.gz: 2450ffc17a6e8efe1e8bc3195136253bce595f91e098018e890d5e182fe837beb98d6dbba3a3d22c0f3e2db3d58b4104213042d3898c4e457e53f6076860e04d
7
- data.tar.gz: 301cbb253cc736a39264476385e595f4b0c07f9dbcecec3a39325176c964a6ec51f582d2acf29cdfb90ead7fec3f586e136f2850918349db9d82e86e7b18af6f
6
+ metadata.gz: a8e3e1a324bfeade0a331f89de454de9909b8ad564d16849d56e5dc624dacf69d7c79c46547bee630f6fef9ad89f3275b5811203c93288dcdf5548c975e26ab7
7
+ data.tar.gz: 5f4bcd4c8f6a688f78add975c78cfcb6995b0777ab73f38beae6f4f2760b70816a39fc9af56952c43c81ba691e9336a51745fe4ddb2745cafc999d084794cb38
data/README.md CHANGED
@@ -42,68 +42,68 @@ You are encouraged to read the cucumber feature files
42
42
  for the *tau* commands
43
43
  to get an idea of how the commands work.
44
44
  You can list the *tau* commands by running
45
- *tau [self list](features/takelage/self/self.list.feature)*
45
+ *tau [self list](features/cucumber/features/self/self.list.feature)*
46
46
  or *tau list*:
47
47
 
48
48
  Command | Description
49
49
  ------- | -----------
50
- tau [bit check workspace](features/takelage/bit/bit.check.workspace.feature) | Check if a bit workspace exists
51
- tau [bit clipboard copy](features/takelage/bit/bit.clipboard.copy.feature) [DIR] [SCOPE] | Copy new [DIR] to [SCOPE]
52
- tau [bit clipboard paste](features/takelage/bit/bit.clipboard.paste.feature) [COMPONENT] [DIR] | Paste bit [COMPONENT] into [DIR]
53
- tau [bit clipboard pull](features/takelage/bit/bit.clipboard.pull.feature) | Pull all updates for bit components from bit remote scopes
54
- tau [bit clipboard push](features/takelage/bit/bit.clipboard.push.feature) | Push all updates of bit components to bit remote scopes
55
- tau [bit require export](features/takelage/bit/bit.require.export.feature) | Show requirements file of bit components
56
- tau [bit require import](features/takelage/bit/bit.require.import.feature) | Import bit components from requirements file
57
- tau [bit scope add](features/takelage/bit/bit.scope.add.feature) [SCOPE] | Add a bit [SCOPE]
58
- tau [bit scope inbit](features/takelage/bit/bit.scope.inbit.feature) | Log in to bit remote server
59
- tau [bit scope list](features/takelage/bit/bit.scope.list.feature) | List bit remote scopes
60
- tau [bit scope new](features/takelage/bit/bit.scope.new.feature) [SCOPE] | Init a new bit [SCOPE]
61
- tau [completion bash](features/takelage/completion/completion.bash.feature) | Print bash completion code
62
- tau [docker check running](features/takelage/docker/docker.check.running.feature) | Check if docker daemon is running
63
- tau [docker container check existing](features/takelage/docker/docker.container.check.existing.feature) [CONTAINER] | Check if docker [CONTAINER] is existing
64
- tau [docker container check network](features/takelage/docker/docker.container.check.network.feature) [NETWORK] | Check if docker [NETWORK] is existing
65
- tau [docker container check orphaned](features/takelage/docker/docker.container.check.orphaned.feature) [CONTAINER] | Check if docker [CONTAINER] is orphaned
66
- tau [docker container command](features/takelage/docker/docker.container.command.feature) [CMD] | Run [CMD] in a docker container
67
- tau [docker container daemon](features/takelage/docker/docker.container.daemon.feature) | Run docker container in daemon mode
68
- tau [docker container login](features/takelage/docker/docker.container.login.feature) | Log in to latest local docker container
69
- tau [docker container clean](features/takelage/docker/docker.container.clean.feature) | Remove all docker containers
70
- tau [docker container prune](features/takelage/docker/docker.container.prune.feature) | Remove orphaned docker containers
71
- tau [docker image check outdated](features/takelage/docker/docker.image.check.outdated.feature) | Check if a docker image is outdated
72
- tau [docker image tag check local](features/takelage/docker/docker.image.tag.check.local.feature) [TAG] | Check if local docker image [TAG] exists
73
- tau [docker image tag check remote](features/takelage/docker/docker.image.tag.check.remote.feature) [TAG] | Check if remote docker image [TAG] exists
74
- tau [docker image tag latest local](features/takelage/docker/docker.image.tag.latest.local.feature) | Print latest local docker image tag
75
- tau [docker image tag latest remote](features/takelage/docker/docker.image.tag.latest.remote.feature) | Print latest remote docker image tag
76
- tau [docker image tag list local](features/takelage/docker/docker.image.tag.list.local.feature) | Print local docker image tags
77
- tau [docker image tag list remote](features/takelage/docker/docker.image.tag.list.remote.feature) | Print remote docker image tags
78
- tau [docker image update](features/takelage/docker/docker.image.update.feature) | Get latest remote docker container
79
- tau [docker socket host](features/takelage/docker/docker.socket.host.feature) | Print docker socket host ip address
80
- tau [docker socket scheme](features/takelage/docker/docker.socket.scheme.feature) | Print docker socket scheme
81
- tau [docker socket start](features/takelage/docker/docker.socket.start.feature) | Start sockets for docker container
82
- tau [docker socket stop](features/takelage/docker/docker.socket.stop.feature) | Stop sockets for docker container
83
- tau [git check clean](features/takelage/git/git.check.clean.feature) | Check if the git workspace is clean
84
- tau [git check master](features/takelage/git/git.check.master.feature) | Check if we are on the git master branch
85
- tau [git check workspace](features/takelage/git/git.check.workspace.feature) | Check if a git workspace exists
86
- tau [info project active](features/takelage/info/info.project.active.feature) | Print active project info
87
- tau [info project main](features/takelage/info/info.project.main.feature) | Print main project info
88
- tau [info project private](features/takelage/info/info.project.private.feature) | Print private project info
89
- tau [self config active](features/takelage/self/self.config.active.feature) | Print active takelage configuration
90
- tau [self config default](features/takelage/self/self.config.default.feature) | Print takelage default configuration
91
- tau [self config home](features/takelage/self/self.config.home.feature) | Print takelage home config file configuration
92
- tau [self config project](features/takelage/self/self.config.project.feature) | Print takelage project config file configuration
93
- tau [self list](features/takelage/self/self.list.feature) | List all commands
94
- tau [self version](features/takelage/self/self.version.feature) | Print tau semantic version number
95
- tau config | Alias for tau [self config active](features/takelage/self/self.config.active.feature)
96
- tau copy [DIR] [SCOPE] | Alias for tau [bit clipboard copy](features/takelage/bit/bit.clipboard.copy.feature)
97
- tau list | Alias for tau [self list](features/takelage/self/self.list.feature)
98
- tau login | Alias for tau [docker container login](features/takelage/docker/docker.container.login.feature)
99
- tau clean | Alias for tau [docker container clean](features/takelage/docker/docker.container.clean.feature)
100
- tau paste [COMPONENT] [DIR] | Alias for tau [bit clipboard paste](features/takelage/bit/bit.clipboard.paste.feature)
101
- tau project | Alias for tau [info project active](features/takelage/info/info.project.active.feature)
102
- tau pull | Alias for tau [bit clipboard pull](features/takelage/bit/bit.clipboard.pull.feature)
103
- tau prune | Alias for tau [docker container prune](features/takelage/docker/docker.container.prune.feature)
104
- tau push | Alias for tau [bit clipboard push](features/takelage/bit/bit.clipboard.push.feature)
105
- tau update | Alias for tau [docker image update](features/takelage/docker/docker.image.update.feature)
106
- tau version | Alias for tau [self version](features/takelage/self/self.version.feature)
50
+ tau [bit check workspace](features/cucumber/features/bit/bit.check.workspace.feature) | Check if a bit workspace exists
51
+ tau [bit clipboard copy](features/cucumber/features/bit/bit.clipboard.copy.feature) [DIR] [SCOPE] | Copy new [DIR] to [SCOPE]
52
+ tau [bit clipboard paste](features/cucumber/features/bit/bit.clipboard.paste.feature) [COMPONENT] [DIR] | Paste bit [COMPONENT] into [DIR]
53
+ tau [bit clipboard pull](features/cucumber/features/bit/bit.clipboard.pull.feature) | Pull all updates for bit components from bit remote scopes
54
+ tau [bit clipboard push](features/cucumber/features/bit/bit.clipboard.push.feature) | Push all updates of bit components to bit remote scopes
55
+ tau [bit require export](features/cucumber/features/bit/bit.require.export.feature) | Show requirements file of bit components
56
+ tau [bit require import](features/cucumber/features/bit/bit.require.import.feature) | Import bit components from requirements file
57
+ tau [bit scope add](features/cucumber/features/bit/bit.scope.add.feature) [SCOPE] | Add a bit [SCOPE]
58
+ tau [bit scope inbit](features/cucumber/features/bit/bit.scope.inbit.feature) | Log in to bit remote server
59
+ tau [bit scope list](features/cucumber/features/bit/bit.scope.list.feature) | List bit remote scopes
60
+ tau [bit scope new](features/cucumber/features/bit/bit.scope.new.feature) [SCOPE] | Init a new bit [SCOPE]
61
+ tau [completion bash](features/cucumber/features/completion/completion.bash.feature) | Print bash completion code
62
+ tau [docker check running](features/cucumber/features/docker/docker.check.running.feature) | Check if docker daemon is running
63
+ tau [docker container check existing](features/cucumber/features/docker/docker.container.check.existing.feature) [CONTAINER] | Check if docker [CONTAINER] is existing
64
+ tau [docker container check network](features/cucumber/features/docker/docker.container.check.network.feature) [NETWORK] | Check if docker [NETWORK] is existing
65
+ tau [docker container check orphaned](features/cucumber/features/docker/docker.container.check.orphaned.feature) [CONTAINER] | Check if docker [CONTAINER] is orphaned
66
+ tau [docker container command](features/cucumber/features/docker/docker.container.command.feature) [CMD] | Run [CMD] in a docker container
67
+ tau [docker container daemon](features/cucumber/features/docker/docker.container.daemon.feature) | Run docker container in daemon mode
68
+ tau [docker container login](features/cucumber/features/docker/docker.container.login.feature) | Log in to latest local docker container
69
+ tau [docker container clean](features/cucumber/features/docker/docker.container.clean.feature) | Remove all docker containers
70
+ tau [docker container prune](features/cucumber/features/docker/docker.container.prune.feature) | Remove orphaned docker containers
71
+ tau [docker image check outdated](features/cucumber/features/docker/docker.image.check.outdated.feature) | Check if a docker image is outdated
72
+ tau [docker image tag check local](features/cucumber/features/docker/docker.image.tag.check.local.feature) [TAG] | Check if local docker image [TAG] exists
73
+ tau [docker image tag check remote](features/cucumber/features/docker/docker.image.tag.check.remote.feature) [TAG] | Check if remote docker image [TAG] exists
74
+ tau [docker image tag latest local](features/cucumber/features/docker/docker.image.tag.latest.local.feature) | Print latest local docker image tag
75
+ tau [docker image tag latest remote](features/cucumber/features/docker/docker.image.tag.latest.remote.feature) | Print latest remote docker image tag
76
+ tau [docker image tag list local](features/cucumber/features/docker/docker.image.tag.list.local.feature) | Print local docker image tags
77
+ tau [docker image tag list remote](features/cucumber/features/docker/docker.image.tag.list.remote.feature) | Print remote docker image tags
78
+ tau [docker image update](features/cucumber/features/docker/docker.image.update.feature) | Get latest remote docker container
79
+ tau [docker socket host](features/cucumber/features/docker/docker.socket.host.feature) | Print docker socket host ip address
80
+ tau [docker socket scheme](features/cucumber/features/docker/docker.socket.scheme.feature) | Print docker socket scheme
81
+ tau [docker socket start](features/cucumber/features/docker/docker.socket.start.feature) | Start sockets for docker container
82
+ tau [docker socket stop](features/cucumber/features/docker/docker.socket.stop.feature) | Stop sockets for docker container
83
+ tau [git check clean](features/cucumber/features/git/git.check.clean.feature) | Check if the git workspace is clean
84
+ tau [git check master](features/cucumber/features/git/git.check.master.feature) | Check if we are on the git master branch
85
+ tau [git check workspace](features/cucumber/features/git/git.check.workspace.feature) | Check if a git workspace exists
86
+ tau [info project active](features/cucumber/features/info/info.project.active.feature) | Print active project info
87
+ tau [info project main](features/cucumber/features/info/info.project.main.feature) | Print main project info
88
+ tau [info project private](features/cucumber/features/info/info.project.private.feature) | Print private project info
89
+ tau [self config active](features/cucumber/features/self/self.config.active.feature) | Print active takelage configuration
90
+ tau [self config default](features/cucumber/features/self/self.config.default.feature) | Print takelage default configuration
91
+ tau [self config home](features/cucumber/features/self/self.config.home.feature) | Print takelage home config file configuration
92
+ tau [self config project](features/cucumber/features/self/self.config.project.feature) | Print takelage project config file configuration
93
+ tau [self list](features/cucumber/features/self/self.list.feature) | List all commands
94
+ tau [self version](features/cucumber/features/self/self.version.feature) | Print tau semantic version number
95
+ tau config | Alias for tau [self config active](features/cucumber/features/self/self.config.active.feature)
96
+ tau copy [DIR] [SCOPE] | Alias for tau [bit clipboard copy](features/cucumber/features/bit/bit.clipboard.copy.feature)
97
+ tau list | Alias for tau [self list](features/cucumber/features/self/self.list.feature)
98
+ tau login | Alias for tau [docker container login](features/cucumber/features/docker/docker.container.login.feature)
99
+ tau clean | Alias for tau [docker container clean](features/cucumber/features/docker/docker.container.clean.feature)
100
+ tau paste [COMPONENT] [DIR] | Alias for tau [bit clipboard paste](features/cucumber/features/bit/bit.clipboard.paste.feature)
101
+ tau project | Alias for tau [info project active](features/cucumber/features/info/info.project.active.feature)
102
+ tau pull | Alias for tau [bit clipboard pull](features/cucumber/features/bit/bit.clipboard.pull.feature)
103
+ tau prune | Alias for tau [docker container prune](features/cucumber/features/docker/docker.container.prune.feature)
104
+ tau push | Alias for tau [bit clipboard push](features/cucumber/features/bit/bit.clipboard.push.feature)
105
+ tau update | Alias for tau [docker image update](features/cucumber/features/docker/docker.image.update.feature)
106
+ tau version | Alias for tau [self version](features/cucumber/features/self/self.version.feature)
107
107
 
108
108
  **Warning: *tau update* will call *docker image prune* and remove all dangling images!**
109
109
 
@@ -115,7 +115,7 @@ tau version | Alias for tau [self version](features/takelage/self/self.version.f
115
115
  which have different precedences.
116
116
  They are merged to an active configuration during runtime
117
117
  which can be inspected with
118
- *tau [self config active](features/takelage/self/self.config.active.feature)*
118
+ *tau [self config active](features/cucumber/features/self/self.config.active.feature)*
119
119
  or *tau config*.
120
120
 
121
121
  | Filename | Precedence | Description |
@@ -168,7 +168,7 @@ Furthermore, every external command can be reconfigured.
168
168
  which have different precedences.
169
169
  They are merged to an active configuration during runtime
170
170
  which can be inspected with
171
- *tau [info project active](features/takelage/info/info.project.active.feature)*
171
+ *tau [info project active](features/cucumber/features/info/info.project.active.feature)*
172
172
  or *tau project*.
173
173
 
174
174
  | Default filename | Config key | Precedence | Description |
@@ -9,6 +9,8 @@ module BitClipboardCopy
9
9
 
10
10
  log.debug "Running bit copy \"#{dir}\" to \"#{scope}\""
11
11
 
12
+ return false unless configured? %w[project_root_dir]
13
+
12
14
  return false unless _bit_clipboard_lib_prepare_workspace
13
15
 
14
16
  unless File.directory? dir
@@ -51,7 +51,7 @@ module BitClipboardLib
51
51
  def _bit_clipboard_lib_sync_workspace
52
52
  log.debug 'Syncing git workspace'
53
53
 
54
- _rakefile, path = Rake.application.find_rakefile_location
54
+ path = config.active['project_root_dir']
55
55
  file = "#{path}/.bitmap"
56
56
  message = 'Update .bitmap'
57
57
 
@@ -6,6 +6,8 @@ module BitClipboardPaste
6
6
  def bit_clipboard_paste(cid, dir)
7
7
  log.debug "Running bit paste \"#{cid}\" to \"#{dir}\""
8
8
 
9
+ return false unless configured? %w[project_root_dir]
10
+
9
11
  return false unless _bit_clipboard_lib_prepare_workspace
10
12
 
11
13
  return false unless _bit_clipboard_paste_cid_exists? cid
@@ -6,6 +6,8 @@ module BitClipboardPull
6
6
  def bit_clipboard_pull
7
7
  log.debug 'Running bit pull'
8
8
 
9
+ return false unless configured? %w[project_root_dir]
10
+
9
11
  return false unless _bit_clipboard_lib_prepare_workspace
10
12
 
11
13
  _bit_clipboard_pull_import_all
@@ -6,6 +6,8 @@ module BitClipboardPush
6
6
  def bit_clipboard_push
7
7
  log.debug 'Running bit push'
8
8
 
9
+ return false unless configured? %w[project_root_dir]
10
+
9
11
  return false unless _bit_clipboard_lib_prepare_workspace
10
12
 
11
13
  _bit_clipboard_push_tag_all
@@ -6,6 +6,8 @@ module BitRequireExport
6
6
  def bit_require_export
7
7
  log.debug 'Running bit require export'
8
8
 
9
+ return false unless configured? %w[project_root_dir]
10
+
9
11
  components = _bit_require_lib_get_components
10
12
  bitrequire_yml = _bit_require_export_get_bitrequire_yml components
11
13
 
@@ -6,6 +6,8 @@ module BitRequireImport
6
6
  def bit_require_import
7
7
  log.debug 'Running bit require import'
8
8
 
9
+ return false unless configured? %w[project_root_dir]
10
+
9
11
  return false unless _bit_clipboard_lib_prepare_workspace
10
12
 
11
13
  return false unless _bit_require_import_check_require_file_exists
@@ -84,7 +86,9 @@ module BitRequireImport
84
86
 
85
87
  # Paste bit components.
86
88
  def _bit_require_import_paste_components(components)
87
- _rakefile, path = Rake.application.find_rakefile_location
89
+ path = config.active['project_root_dir']
90
+ return false if path.empty?
91
+
88
92
  components.each do |component|
89
93
  next if _bit_require_import_check_component_exists component, path
90
94
 
@@ -21,12 +21,15 @@ module ConfigModule
21
21
  # Initialze config
22
22
  # rubocop:disable Metrics/AbcSize
23
23
  def initialize_config
24
+ project_root_dir = _get_project_root_dir
25
+
24
26
  log.debug "takelage version: #{Takelage::VERSION}"
25
27
  log.debug "Current working directory: #{Dir.pwd}"
28
+ log.debug "Project root directory: #{project_root_dir}" unless project_root_dir.empty?
26
29
 
27
- TakelageConfig.instance.default = _config_read_default
30
+ TakelageConfig.instance.default = _config_read_default project_root_dir
28
31
  TakelageConfig.instance.home = _config_read_home
29
- TakelageConfig.instance.project = _config_read_project
32
+ TakelageConfig.instance.project = _config_read_project project_root_dir
30
33
  TakelageConfig.instance.active = _config_merge_active
31
34
  end
32
35
  # rubocop:enable Metrics/AbcSize
@@ -62,19 +65,25 @@ module ConfigModule
62
65
  takel_config_key = TakelageConfig.instance.active[config_key]
63
66
  return true unless takel_config_key.nil? || takel_config_key.empty?
64
67
 
65
- log.error "Unset config key. Please configure \"#{config_key}\""
68
+ if config_key == 'project_root_dir'
69
+ log.error 'Please create a "Rakefile" in the project root directory'
70
+ else
71
+ log.error "Unset config key. Please configure \"#{config_key}\""
72
+ end
66
73
  @configured = false
67
74
  false
68
75
  end
69
76
 
70
77
  # Read default config file in lib.
71
- def _config_read_default
78
+ def _config_read_default(project_root_dir)
72
79
  default_file = File.expand_path("#{File.dirname(__FILE__)}/../default.yml")
73
80
 
74
- return {} unless File.exist? default_file
81
+ return { project_root_dir: project_root_dir } unless File.exist? default_file
75
82
 
76
83
  default_yaml = read_yaml_file(default_file) || {}
77
84
 
85
+ default_yaml['project_root_dir'] = project_root_dir
86
+
78
87
  default_yaml.sort.to_h
79
88
  end
80
89
 
@@ -89,10 +98,9 @@ module ConfigModule
89
98
  home_yaml.sort.to_h
90
99
  end
91
100
 
92
- # Read custom config file next to Rakefile.
93
- def _config_read_project
94
- _rakefile, path = Rake.application.find_rakefile_location
95
- project_file = "#{path}/takelage.yml"
101
+ # Read custom config file in project root.
102
+ def _config_read_project(project_root_dir)
103
+ project_file = "#{project_root_dir}/takelage.yml"
96
104
 
97
105
  return {} unless File.exist? project_file
98
106
 
@@ -113,4 +121,14 @@ module ConfigModule
113
121
  project_over_home = home.merge!(project)
114
122
  default.merge!(project_over_home).sort.to_h
115
123
  end
124
+
125
+ # Get project root directory.
126
+ # @return [String] project root directory
127
+ def _get_project_root_dir
128
+ _rakefile, path = Rake.application.find_rakefile_location
129
+ return path unless path.nil?
130
+
131
+ log.debug 'No "Rakefile" found. Cannot determine project root directory.'
132
+ ''
133
+ end
116
134
  end
@@ -34,7 +34,7 @@ module ProjectModule
34
34
 
35
35
  # Read main YAML file.
36
36
  def _project_read_main
37
- _rakefile, @path = Rake.application.find_rakefile_location
37
+ @path = TakelageProject.instance.config.active['project_root_dir']
38
38
  main_file = "#{@path}/" \
39
39
  "#{TakelageProject.instance.config.active['info_project_main']}"
40
40
 
@@ -45,7 +45,7 @@ module ProjectModule
45
45
 
46
46
  # Read private YAML file.
47
47
  def _project_read_private
48
- _rakefile, @path = Rake.application.find_rakefile_location
48
+ @path = TakelageProject.instance.config.active['project_root_dir']
49
49
  private_file = "#{@path}/" \
50
50
  "#{TakelageProject.instance.config.active['info_project_private']}"
51
51
 
@@ -1 +1 @@
1
- 0.20.1
1
+ 0.20.2
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: takelage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.1
4
+ version: 0.20.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Geospin