atk_toolbox 0.0.140 → 0.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fce2cf8566ad1ae4116ab41913db6f59c048454e745a2d222803573b3fef921d
4
- data.tar.gz: da8200cc335292514a0b31007c7c75bf2136889028908c89da4e124c92797bf1
3
+ metadata.gz: 81d2409b4a27038a1a67eddc395ae7011f6661b1f3757041546f309460c46512
4
+ data.tar.gz: f92af6b3bb8f65d8e500e4b602001d06be85337c44daf9c508a137ff94a1ed9a
5
5
  SHA512:
6
- metadata.gz: a9a8583fe658af979cc33d24085b5d8ca1581297f7512d78671c06eda19001edda5f52b289bc43c353ba0b346ac4c77ef40a4cca4b389fce99356228722dd046
7
- data.tar.gz: b9c487c84965c94ddf0021a7523479137af7d61161a13d5d011c47f58da7f2c1809cc6414b5e10ecc44b874af13db79180e0ad073a0b732c5a31750f85302f41
6
+ metadata.gz: 1248501b11111ea0a6052bf9d44571dcb5b6e4c9bac12117b215caf82045ee23fac51420afac94bb04304d6d244ca1f8095d990432f8e2cc37c843fefb488cf1
7
+ data.tar.gz: 193cc7d5307a6e090ddc60ea03153fe67985554b5d12d79ce7d543a13662dc354ae54c8f75c27a33c5e50428bbf18ee644e68c84287012aef35221d67f0234bd
@@ -1,7 +1,7 @@
1
1
  require 'atk_toolbox'
2
2
 
3
3
  previous_version = Console.args[0]
4
- puts "previous_version is: #{previous_version} "
4
+ # TODO: previous_version is currently always null
5
5
 
6
6
  # helper function
7
7
  download_and_install_command = ->(command) do
@@ -103,7 +103,7 @@ module Atk
103
103
  errors = {}
104
104
 
105
105
  # make sure ruby is the corrct version
106
- if VERSION_OF_RUBY >= Version.new("3.0.0")
106
+ if VERSION_OF_RUBY >= Version.new("2.6.0")
107
107
  errors[:ruby_version_too_high] = true
108
108
  elsif VERSION_OF_RUBY < Version.new("2.5")
109
109
  errors[:ruby_version_too_low] = true
@@ -138,7 +138,10 @@ module Atk
138
138
  #
139
139
  # TODO: talk about any found errors
140
140
  #
141
-
141
+ if errors.include?[:ruby_version_too_high]
142
+ puts "It looks like your ruby version is too high for ATK"
143
+ puts "some parts of ATK might still work, however expect it to be broken"
144
+ end
142
145
  end
143
146
 
144
147
  def self.setup(package_name, arguments)
@@ -398,25 +401,25 @@ class AtkPackage
398
401
 
399
402
  if @dont_exist[:yaml_file]
400
403
  custom_message += <<-HEREDOC.remove_indent
401
- #{bad("there was no info.yaml for that package")}
404
+ #{bad["there was no info.yaml for that package"]}
402
405
  and an info.yaml is the location for defining a run action
403
406
 
404
407
  HEREDOC
405
408
  elsif @dont_exist[:correctly_formatted_yaml_file]
406
409
  custom_message += <<-HEREDOC.remove_indent
407
- #{good("there was a info.yaml for that package")}
408
- #{bad("the info.yaml is not parseable")}
410
+ #{good["there was a info.yaml for that package"]}
411
+ #{bad["the info.yaml is not parseable"]}
409
412
  and an info.yaml is the location for defining a run action
410
413
 
411
414
  HEREDOC
412
415
  elsif @dont_exist[:using_atk_version]
413
416
  custom_message += <<-HEREDOC.remove_indent
414
- #{good("there was a info.yaml for that package")}
415
- #{good("the info.yaml was parseable")}
416
- #{@dont_exist[:using_atk_version] && bad("the info.yaml didn't have a (using_atk_version) key")}
417
- #{@dont_exist[:package_info] && bad("the info.yaml didn't have a (package_info) key")}
418
- #{@dont_exist[:actions] && bad("the info.yaml didn't have a (package_info): (actions) key")}
419
- #{@dont_exist[:run_action] && bad("the info.yaml didn't have a (package_info): (actions): (run) key")}
417
+ #{good["there was a info.yaml for that package"]}
418
+ #{good["the info.yaml was parseable"]}
419
+ #{@dont_exist[:using_atk_version] && bad["the info.yaml didn't have a (using_atk_version) key"]}
420
+ #{@dont_exist[:package_info] && bad["the info.yaml didn't have a (package_info) key"]}
421
+ #{@dont_exist[:actions] && bad["the info.yaml didn't have a (package_info): (actions) key"]}
422
+ #{@dont_exist[:run_action] && bad["the info.yaml didn't have a (package_info): (actions): (run) key"]}
420
423
  HEREDOC
421
424
  end
422
425
 
@@ -10,4 +10,31 @@ module Atk
10
10
  # end
11
11
  # end
12
12
  end
13
+
14
+ #
15
+ # zsh autocomplete
16
+ #
17
+ #compdef _
18
+
19
+ # _atk()
20
+ # {
21
+ # orig_words=( ${words[@]} )
22
+ # local comp_words="${COMP_WORDS[1]}"
23
+ # local comp_cword="${COMP_CWORD}"
24
+ # local mylist="$( ruby -e '
25
+ # require "yaml"
26
+ # class Nil ; def [](); end; end;
27
+ # if ARGV.length == 2
28
+ # puts YAML.load_file("./info.yaml")["(project)"]["(commands)"].keys.map{|each| each.inspect}
29
+ # else
30
+ # # puts `ls`
31
+ # end
32
+ # ' $orig_words
33
+ # )"
34
+ # COMPREPLY=($(compgen -W $mylist) )
35
+ # _alternative "arguments:custom arg:(($mylist))"
36
+ # }
37
+
38
+ # complete -F _atk _
39
+ # compdef _atk _
13
40
  end
@@ -1,6 +1,12 @@
1
1
  require_relative '../atk_info'
2
2
 
3
3
  module Atk
4
+ class ExecFailed < Exception
5
+ end
6
+
7
+ class NoSuchCommand < Exception
8
+ end
9
+
4
10
  def self.project(args)
5
11
  #
6
12
  # no arguments
@@ -136,17 +142,17 @@ module Atk
136
142
  # temporairly set the dir to be the same as the info.yaml
137
143
  FS.in_dir(Info.folder()) do
138
144
  if command.is_a?(String)
139
- result = system(command+' '+command_args.join(' '))
145
+ result = system(command+' '+Console.make_arguments_appendable(command_args))
140
146
  elsif command.is_a?(Code)
141
147
  result = command.run(*command_args)
142
148
  elsif command == nil
143
- puts "I don't think that command is in the info.yaml file"
149
+ raise NoSuchCommand
144
150
  end
145
151
 
146
152
  # if command resulted in error then raise an error
147
153
  if not result
148
154
  colored_command_name = command_name.color_as :key_term
149
- raise <<-HEREDOC.remove_indent
155
+ raise ExecFailed, <<-HEREDOC.remove_indent
150
156
 
151
157
  When running: #{"project execute ".color_as :code}#{colored_command_name}
152
158
  The script for #{colored_command_name} hit an error and had an exit code of: #{$?.exitstatus}
@@ -235,7 +235,7 @@ Console = Class.new do
235
235
 
236
236
  # users are going to have to manually escape things like ^, !, % etc depending on the context they're used in
237
237
 
238
- simple_char = "[a-zA-Z0-9_.,;`=-*?\\/\\[\\]]"
238
+ simple_char = "[a-zA-Z0-9_.,;`=\\-*?\\/\\[\\]]"
239
239
 
240
240
  # if its a simple argument just pass it on
241
241
  if argument =~ /\A(#{simple_char})*\z/
@@ -152,6 +152,7 @@ class Info
152
152
  rescue => exception
153
153
  # if no version, then don't worry about parsing
154
154
  end
155
+
155
156
  if @version.is_a?(Version)
156
157
  begin
157
158
  if @version <= Version.new("1.0.0")
@@ -1,3 +1,5 @@
1
+ require 'ruby2_keywords'
2
+
1
3
  # require all the ruby files
2
4
  files = Dir.glob(File.join(__dir__, "atk", "**/*.rb"))
3
5
  for each in files
@@ -1,3 +1,3 @@
1
1
  module AtkToolbox
2
- VERSION = '0.0.140'
2
+ VERSION = '0.0.145'
3
3
  end
@@ -1,46 +1,15 @@
1
- (using_atk_version): 1.0
1
+ (using_atk_version): 1.1.0
2
2
  (project):
3
3
  name: A Project
4
4
  description: A new project
5
5
 
6
- paths: &paths
7
- root: ./
8
- testing_folder: &tests ./code/tests
9
- cpp_tests: [ *tests, cpp ]
10
-
11
- commands: &commands # if you dont know what the & means, see https://blog.daemonl.com/2016/02/yaml.html
12
- build_mac: !language/ruby |
13
- require 'atk_toolbox'
14
- file = FS.read('./mac/setup_readable_version.sh')
15
- # remove comments
16
- file.gsub!(/^ *#.+\n/, "")
17
- # make everything a single line
18
- file = file.split("\n").join(";")
19
- # save
20
- FS.write(file, to: './mac/setup.sh')
21
-
22
- dependencies: &dependencies
23
- atk: 0.0.1
24
-
25
- (advanced_setup):
26
- (paths):
27
- <<: *paths
28
- (put_new_dependencies_under): [ '(project)', 'basic_info', 'dependencies' ]
29
- # caveats for a specific OS
30
- when(--os is 'mac'):
31
- (project_commands):
32
- <<: *commands
33
- (dependencies):
34
- <<: *dependencies
35
-
36
- when(--os is 'windows'):
37
- (project_commands):
38
- <<: *commands
39
- (dependencies):
40
- <<: *dependencies
41
-
42
- when(--os is 'linux'):
43
- (project_commands):
44
- <<: *commands
45
- (dependencies):
46
- <<: *dependencies
6
+ (commands): &commands # if you dont know what the & means, see https://blog.daemonl.com/2016/02/yaml.html
7
+ test_commands:
8
+ ruby test/main.rb
9
+ (setup):
10
+ # a library that helps with publishing
11
+ gem install gem-release
12
+ publish:
13
+ ruby scripts/publish.rb
14
+ test_changes:
15
+ ruby scripts/test_changes.rb && ruby ./lib/after_gem_update.rb
metadata CHANGED
@@ -1,33 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atk_toolbox
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.140
4
+ version: 0.0.145
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Hykin
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-31 00:00:00.000000000 Z
11
+ date: 2020-06-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.19.0
20
- - - ">="
20
+ - - "~>"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 0.19.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 0.19.0
30
- - - ">="
30
+ - - "~>"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 0.19.0
33
33
  description: ''
@@ -58,7 +58,7 @@ homepage: http://github.com//atk-toolbox
58
58
  licenses:
59
59
  - CC-BY-ND-4.0
60
60
  metadata: {}
61
- post_install_message:
61
+ post_install_message:
62
62
  rdoc_options: []
63
63
  require_paths:
64
64
  - "./lib"
@@ -73,9 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
75
  requirements: []
76
- rubyforge_project:
77
- rubygems_version: 2.7.6.2
78
- signing_key:
76
+ rubygems_version: 3.0.3
77
+ signing_key:
79
78
  specification_version: 4
80
79
  summary: The Ruby gem for all the standard tools ATK uses internally
81
80
  test_files: []