raketeer 0.2.5 → 0.2.10

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.
data/lib/raketeer/irb.rb CHANGED
@@ -1,23 +1,9 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
21
7
  #++
22
8
 
23
9
 
@@ -25,11 +11,11 @@ require 'raketeer/irb_task'
25
11
 
26
12
  module Raketeer
27
13
  ###
28
- # @author Jonathan Bradley Whited (@esotericpig)
14
+ # @author Jonathan Bradley Whited
29
15
  # @since 0.2.0
30
16
  ###
31
17
  module IRB
32
18
  end
33
19
  end
34
20
 
35
- Raketeer::IRBTask.new() # @since 0.2.0
21
+ Raketeer::IRBTask.new # @since 0.2.0
@@ -1,23 +1,9 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
21
7
  #++
22
8
 
23
9
 
@@ -29,7 +15,7 @@ require 'raketeer/util'
29
15
 
30
16
  module Raketeer
31
17
  ###
32
- # @author Jonathan Bradley Whited (@esotericpig)
18
+ # @author Jonathan Bradley Whited
33
19
  # @since 0.1.0
34
20
  ###
35
21
  class IRBTask < Rake::TaskLib
@@ -38,30 +24,30 @@ module Raketeer
38
24
  attr_accessor :main_module
39
25
  attr_accessor :name
40
26
  attr_accessor :warning
41
-
27
+
42
28
  alias_method :warning?,:warning
43
-
29
+
44
30
  def initialize(name=:irb)
45
31
  super()
46
-
32
+
47
33
  @description = 'Open an irb session loaded with this library'
48
- @main_module = Util.find_main_module()
34
+ @main_module = Util.find_main_module
49
35
  @name = name
50
36
  @warning = true
51
-
37
+
52
38
  @irb_cmd = ['irb']
53
39
  @irb_cmd.push('-r','rubygems')
54
40
  @irb_cmd.push('-r','bundler/setup')
55
-
56
- yield self if block_given?()
57
-
58
- @irb_cmd.push('-r',@main_module) unless @main_module.nil?()
41
+
42
+ yield self if block_given?
43
+
44
+ @irb_cmd.push('-r',@main_module) unless @main_module.nil?
59
45
  @irb_cmd << '-w' if @warning
60
-
61
- define()
46
+
47
+ define
62
48
  end
63
-
64
- def define()
49
+
50
+ def define
65
51
  desc @description
66
52
  task @name do |task,args|
67
53
  sh(*@irb_cmd)
@@ -1,23 +1,9 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
21
7
  #++
22
8
 
23
9
 
@@ -27,90 +13,90 @@ require 'rake/tasklib'
27
13
 
28
14
  module Raketeer
29
15
  ###
30
- # @author Jonathan Bradley Whited (@esotericpig)
16
+ # @author Jonathan Bradley Whited
31
17
  # @since 0.1.0
32
18
  ###
33
19
  class NokogiriInstallTask < Rake::TaskLib
34
20
  attr_accessor :description
35
21
  attr_accessor :install_cmd
36
22
  attr_accessor :name
37
-
23
+
38
24
  def initialize(name)
39
25
  super()
40
-
26
+
41
27
  @description = nil
42
28
  @install_cmd = nil
43
29
  @name = name
44
30
  end
45
-
31
+
46
32
  def define(&block)
47
- block.call(self) unless block.nil?()
48
-
33
+ block&.call(self)
34
+
49
35
  desc @description
50
36
  task @name do |task,args|
51
37
  run(task,args)
52
38
  end
53
39
  end
54
-
40
+
55
41
  def run(task,args)
56
42
  sh(*@install_cmd)
57
43
  end
58
44
  end
59
-
45
+
60
46
  ###
61
- # @author Jonathan Bradley Whited (@esotericpig)
47
+ # @author Jonathan Bradley Whited
62
48
  # @since 0.1.0
63
49
  ###
64
50
  class NokogiriAPTTask < NokogiriInstallTask
65
51
  def initialize(name=:nokogiri_apt,&block)
66
52
  super(name)
67
-
53
+
68
54
  @description = 'Install Nokogiri libs for Ubuntu/Debian'
69
-
70
- @install_cmd = ['sudo','apt-get','install']
55
+
56
+ @install_cmd = %w[ sudo apt-get install ]
71
57
  @install_cmd << 'build-essential'
72
58
  @install_cmd << 'libgmp-dev'
73
59
  @install_cmd << 'liblzma-dev'
74
60
  @install_cmd << 'patch'
75
61
  @install_cmd << 'ruby-dev'
76
62
  @install_cmd << 'zlib1g-dev'
77
-
63
+
78
64
  define(&block)
79
65
  end
80
66
  end
81
-
67
+
82
68
  ###
83
- # @author Jonathan Bradley Whited (@esotericpig)
69
+ # @author Jonathan Bradley Whited
84
70
  # @since 0.1.0
85
71
  ###
86
72
  class NokogiriDNFTask < NokogiriInstallTask
87
73
  def initialize(name=:nokogiri_dnf,&block)
88
74
  super(name)
89
-
75
+
90
76
  @description = 'Install Nokogiri libs for Fedora/CentOS/Red Hat'
91
-
92
- @install_cmd = ['sudo','dnf','install']
77
+
78
+ @install_cmd = %w[ sudo dnf install ]
93
79
  @install_cmd << 'gcc'
94
80
  @install_cmd << 'ruby-devel'
95
81
  @install_cmd << 'zlib-devel'
96
-
82
+
97
83
  define(&block)
98
84
  end
99
85
  end
100
-
86
+
101
87
  ###
102
- # @author Jonathan Bradley Whited (@esotericpig)
88
+ # @author Jonathan Bradley Whited
103
89
  # @since 0.1.0
104
90
  ###
105
91
  class NokogiriOtherTask < NokogiriInstallTask
106
92
  def initialize(name=:nokogiri_other,&block)
107
93
  super(name)
108
-
94
+
109
95
  @description = 'Install Nokogiri libs for other OSes'
110
-
96
+
111
97
  define(&block)
112
98
  end
113
-
99
+
114
100
  def run(task,args)
115
101
  puts 'Please go to this link for installing Nokogiri on your system:'
116
102
  puts ' https://nokogiri.org/tutorials/installing_nokogiri.html'
@@ -1,23 +1,9 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
21
7
  #++
22
8
 
23
9
 
@@ -26,14 +12,14 @@ require 'raketeer/nokogiri_install_tasks'
26
12
  module Raketeer
27
13
  ###
28
14
  # Defines all Nokogiri install tasks in your Rakefile.
29
- #
30
- # @author Jonathan Bradley Whited (@esotericpig)
15
+ #
16
+ # @author Jonathan Bradley Whited
31
17
  # @since 0.1.0
32
18
  ###
33
19
  module NokogiriInstalls
34
20
  end
35
21
  end
36
22
 
37
- Raketeer::NokogiriAPTTask.new() # @since 0.1.0
38
- Raketeer::NokogiriDNFTask.new() # @since 0.1.0
39
- Raketeer::NokogiriOtherTask.new() # @since 0.1.0
23
+ Raketeer::NokogiriAPTTask.new # @since 0.1.0
24
+ Raketeer::NokogiriDNFTask.new # @since 0.1.0
25
+ Raketeer::NokogiriOtherTask.new # @since 0.1.0
data/lib/raketeer/run.rb CHANGED
@@ -1,23 +1,9 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
21
7
  #++
22
8
 
23
9
 
@@ -25,11 +11,11 @@ require 'raketeer/run_task'
25
11
 
26
12
  module Raketeer
27
13
  ###
28
- # @author Jonathan Bradley Whited (@esotericpig)
14
+ # @author Jonathan Bradley Whited
29
15
  # @since 0.2.2
30
16
  ###
31
17
  module Run
32
18
  end
33
19
  end
34
20
 
35
- Raketeer::RunTask.new() # @since 0.2.2
21
+ Raketeer::RunTask.new # @since 0.2.2
@@ -1,23 +1,9 @@
1
- #!/usr/bin/env ruby
2
1
  # encoding: UTF-8
3
2
  # frozen_string_literal: true
4
3
 
5
4
  #--
6
5
  # This file is part of Raketeer.
7
- # Copyright (c) 2019 Jonathan Bradley Whited (@esotericpig)
8
- #
9
- # Raketeer is free software: you can redistribute it and/or modify
10
- # it under the terms of the GNU Lesser General Public License as published by
11
- # the Free Software Foundation, either version 3 of the License, or
12
- # (at your option) any later version.
13
- #
14
- # Raketeer is distributed in the hope that it will be useful,
15
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- # GNU Lesser General Public License for more details.
18
- #
19
- # You should have received a copy of the GNU Lesser General Public License
20
- # along with Raketeer. If not, see <https://www.gnu.org/licenses/>.
6
+ # Copyright (c) 2019-2021 Jonathan Bradley Whited
21
7
  #++
22
8
 
23
9
 
@@ -29,7 +15,7 @@ require 'raketeer/util'
29
15
 
30
16
  module Raketeer
31
17
  ###
32
- # @author Jonathan Bradley Whited (@esotericpig)
18
+ # @author Jonathan Bradley Whited
33
19
  # @since 0.2.2
34
20
  ###
35
21
  class RunTask < Rake::TaskLib
@@ -39,38 +25,38 @@ module Raketeer
39
25
  attr_accessor :name
40
26
  attr_accessor :run_cmd
41
27
  attr_accessor :warning
42
-
28
+
43
29
  alias_method :warning?,:warning
44
-
30
+
45
31
  def initialize(name=:run)
46
32
  super()
47
-
33
+
48
34
  @bin_dir = 'bin'
49
35
  @description = %Q(Run this project's main file: "rake #{name} -- --version")
50
36
  @executable = nil
51
37
  @name = name
52
38
  @warning = true
53
-
39
+
54
40
  @run_cmd = ['ruby']
55
41
  @run_cmd.push('-r','rubygems')
56
42
  @run_cmd.push('-r','bundler/setup')
57
-
58
- yield self if block_given?()
59
-
60
- @executable = Util.find_main_executable(@bin_dir) if @executable.nil?()
61
-
43
+
44
+ yield self if block_given?
45
+
46
+ @executable = Util.find_main_executable(@bin_dir) if @executable.nil?
47
+
62
48
  @run_cmd << '-w' if @warning
63
49
  @run_cmd << File.join(@bin_dir,@executable)
64
-
65
- define()
50
+
51
+ define
66
52
  end
67
-
68
- def define()
53
+
54
+ def define
69
55
  desc @description
70
56
  task @name do |task,args|
71
57
  first_arg_index = -1
72
- name_s = @name.to_s()
73
-
58
+ name_s = @name.to_s
59
+
74
60
  # Cut out "--silent" for "rake --silent rt:run -- --version",
75
61
  # else "--silent" will be sent to the executable.
76
62
  ARGV.each_with_index do |arg,i|
@@ -78,25 +64,25 @@ module Raketeer
78
64
  # Rake task names are case-sensitive.
79
65
  if arg.include?(name_s)
80
66
  first_arg_index = i + 1
81
-
67
+
82
68
  break
83
69
  end
84
70
  end
85
-
71
+
86
72
  # In case this is called more than once in some way
87
- sh_cmd = @run_cmd.dup()
88
-
73
+ sh_cmd = @run_cmd.dup
74
+
89
75
  # Are there args for the run command?
90
76
  if first_arg_index >= 0 && first_arg_index < ARGV.length
91
77
  run_args = ARGV.slice!(first_arg_index..-1)
92
-
78
+
93
79
  # Cut out "--" for "rake run -- --version".
94
80
  # For older versions of rake, you didn't need "--", so check for it.
95
81
  run_args.slice!(0) if run_args[0] == '--'
96
-
82
+
97
83
  sh_cmd.push(*run_args)
98
84
  end
99
-
85
+
100
86
  sh(*sh_cmd)
101
87
  end
102
88
  end