instructions_list 1.0.9.4.1.beta → 1.0.10.beta
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 +4 -4
 - data/.instructions/cache/check_child.rb +1 -1
 - data/.instructions/cache/check_ok.rb +4 -4
 - data/exe/il +106 -87
 - data/lib/instructions_list/version.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 7a92a3be12a91a6eeb61536331a1fceff8a930fb
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 0cde8f4a0b3697626698fce31c6b6c0478ccf0f7
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 95971c8aeaa9dc4866bc53d4526d53b6db0586345edb2dc1dd048c8fb6868b904e6abbfdb3c84e677156f45c1d79f0915ba63660055ad70d044b712aeb54142e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 5cbf030565c4042851071efb28b0d8939ba9cfa969d78cca234513dc22742088c1da900e5a3c2e45b2166028cc94232210a309711f65b65bca0b1c38bbc8cbae
         
     | 
| 
         @@ -4,12 +4,12 @@ instruction 'check:ok' do 
     | 
|
| 
       4 
4 
     | 
    
         
             
                It::Is.done? 'check:ok'
         
     | 
| 
       5 
5 
     | 
    
         
             
              }
         
     | 
| 
       6 
6 
     | 
    
         
             
              instruct{
         
     | 
| 
       7 
     | 
    
         
            -
                  
     | 
| 
      
 7 
     | 
    
         
            +
                 system "sudo echo check ok!"
         
     | 
| 
       8 
8 
     | 
    
         
             
              }
         
     | 
| 
       9 
9 
     | 
    
         | 
| 
       10 
10 
     | 
    
         
             
              uninstruct{
         
     | 
| 
       11 
     | 
    
         
            -
                   
     | 
| 
       12 
     | 
    
         
            -
                   
     | 
| 
       13 
     | 
    
         
            -
                   
     | 
| 
      
 11 
     | 
    
         
            +
                  system 'echo poop'
         
     | 
| 
      
 12 
     | 
    
         
            +
                  system 'echo poop you'
         
     | 
| 
      
 13 
     | 
    
         
            +
                  system 'sudo echo poop'
         
     | 
| 
       14 
14 
     | 
    
         
             
                }
         
     | 
| 
       15 
15 
     | 
    
         
             
            end
         
     | 
    
        data/exe/il
    CHANGED
    
    | 
         @@ -23,14 +23,16 @@ module InstructionsList 
     | 
|
| 
       23 
23 
     | 
    
         
             
                desc "reset", "reset state"
         
     | 
| 
       24 
24 
     | 
    
         
             
                def reset
         
     | 
| 
       25 
25 
     | 
    
         | 
| 
       26 
     | 
    
         
            -
                   
     | 
| 
       27 
     | 
    
         
            -
                     
     | 
| 
       28 
     | 
    
         
            -
                  end
         
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
       30 
     | 
    
         
            -
                  if home?
         
     | 
| 
       31 
     | 
    
         
            -
                    Dir.chdir(ENV['HOME']) do
         
     | 
| 
      
 26 
     | 
    
         
            +
                  instructable do
         
     | 
| 
      
 27 
     | 
    
         
            +
                    if project?
         
     | 
| 
       32 
28 
     | 
    
         
             
                      system "rm -rf #{STATE}" if File.exists? STATE
         
     | 
| 
       33 
29 
     | 
    
         
             
                    end
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                    if home?
         
     | 
| 
      
 32 
     | 
    
         
            +
                      Dir.chdir(ENV['HOME']) do
         
     | 
| 
      
 33 
     | 
    
         
            +
                        system "rm -rf #{STATE}" if File.exists? STATE
         
     | 
| 
      
 34 
     | 
    
         
            +
                      end
         
     | 
| 
      
 35 
     | 
    
         
            +
                    end
         
     | 
| 
       34 
36 
     | 
    
         
             
                  end
         
     | 
| 
       35 
37 
     | 
    
         | 
| 
       36 
38 
     | 
    
         
             
                end
         
     | 
| 
         @@ -38,126 +40,134 @@ module InstructionsList 
     | 
|
| 
       38 
40 
     | 
    
         
             
                desc "sync", "synchronize the instructions"
         
     | 
| 
       39 
41 
     | 
    
         
             
                option :reset
         
     | 
| 
       40 
42 
     | 
    
         
             
                def sync key=nil
         
     | 
| 
       41 
     | 
    
         
            -
                   
     | 
| 
       42 
     | 
    
         
            -
                     
     | 
| 
       43 
     | 
    
         
            -
                       
     | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
       46 
     | 
    
         
            -
                         
     | 
| 
      
 43 
     | 
    
         
            +
                  instructable do
         
     | 
| 
      
 44 
     | 
    
         
            +
                    begin
         
     | 
| 
      
 45 
     | 
    
         
            +
                      if project?
         
     | 
| 
      
 46 
     | 
    
         
            +
                        system "mkdir -p #{PROJECT_CACHE}"
         
     | 
| 
      
 47 
     | 
    
         
            +
                        system "mkdir -p #{PROJECT_CACHE_ARTIFACTS}"
         
     | 
| 
      
 48 
     | 
    
         
            +
                        if options[:reset]
         
     | 
| 
      
 49 
     | 
    
         
            +
                          system "rm -rf #{PROJECT_CACHE}" if Dir.exists? PROJECT_CACHE
         
     | 
| 
      
 50 
     | 
    
         
            +
                        end
         
     | 
| 
      
 51 
     | 
    
         
            +
                        CacheBuilder.new(get_key,HOST,cache=PROJECT_CACHE,artifact_cache=PROJECT_CACHE_ARTIFACTS).build
         
     | 
| 
       47 
52 
     | 
    
         
             
                      end
         
     | 
| 
       48 
     | 
    
         
            -
                      CacheBuilder.new(get_key,HOST,cache=PROJECT_CACHE,artifact_cache=PROJECT_CACHE_ARTIFACTS).build
         
     | 
| 
       49 
     | 
    
         
            -
                    end
         
     | 
| 
       50 
53 
     | 
    
         | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
       52 
     | 
    
         
            -
             
     | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
             
     | 
| 
      
 54 
     | 
    
         
            +
                      if home?
         
     | 
| 
      
 55 
     | 
    
         
            +
                        Dir.chdir ENV['HOME'] do
         
     | 
| 
      
 56 
     | 
    
         
            +
                          if options[:reset]
         
     | 
| 
      
 57 
     | 
    
         
            +
                            system "rm -rf #{HOME_CACHE}" if Dir.exists? HOME_CACHE
         
     | 
| 
      
 58 
     | 
    
         
            +
                          end
         
     | 
| 
      
 59 
     | 
    
         
            +
                          CacheBuilder.new(get_key,HOST,cache=HOME_CACHE,artifact_cache=HOME_CACHE_ARTIFACTS).build
         
     | 
| 
       55 
60 
     | 
    
         
             
                        end
         
     | 
| 
       56 
     | 
    
         
            -
                        CacheBuilder.new(get_key,HOST,cache=HOME_CACHE,artifact_cache=HOME_CACHE_ARTIFACTS).build
         
     | 
| 
       57 
61 
     | 
    
         
             
                      end
         
     | 
| 
      
 62 
     | 
    
         
            +
                    rescue SocketError
         
     | 
| 
      
 63 
     | 
    
         
            +
                      say "Ooooops cant find #{HOST}"
         
     | 
| 
       58 
64 
     | 
    
         
             
                    end
         
     | 
| 
       59 
     | 
    
         
            -
                  rescue SocketError
         
     | 
| 
       60 
     | 
    
         
            -
                    say "Ooooops cant find #{HOST}"
         
     | 
| 
       61 
65 
     | 
    
         
             
                  end
         
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
66 
     | 
    
         
             
                end
         
     | 
| 
       64 
67 
     | 
    
         | 
| 
       65 
68 
     | 
    
         | 
| 
       66 
69 
     | 
    
         
             
                desc "list", "list all instructions"
         
     | 
| 
       67 
70 
     | 
    
         
             
                def instructions
         
     | 
| 
       68 
     | 
    
         
            -
                  sync
         
     | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
                  if project?
         
     | 
| 
       71 
     | 
    
         
            -
                    list_from "Project", PROJECT_CACHE << '/' do |name|
         
     | 
| 
       72 
     | 
    
         
            -
                      say show_command_for name
         
     | 
| 
       73 
     | 
    
         
            -
                    end
         
     | 
| 
       74 
     | 
    
         
            -
                    puts ""
         
     | 
| 
       75 
     | 
    
         
            -
                    list_from "Home", HOME_CACHE << '/' do |name|
         
     | 
| 
       76 
     | 
    
         
            -
                      say show_command_for name
         
     | 
| 
       77 
     | 
    
         
            -
                    end
         
     | 
| 
       78 
71 
     | 
    
         | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
      
 72 
     | 
    
         
            +
                  instructable do
         
     | 
| 
       80 
73 
     | 
    
         | 
| 
       81 
     | 
    
         
            -
             
     | 
| 
      
 74 
     | 
    
         
            +
                    if project?
         
     | 
| 
      
 75 
     | 
    
         
            +
                      list_from "", PROJECT_CACHE << '/' do |name|
         
     | 
| 
      
 76 
     | 
    
         
            +
                        say show_command_for name
         
     | 
| 
      
 77 
     | 
    
         
            +
                      end
         
     | 
| 
      
 78 
     | 
    
         
            +
                      puts ""
         
     | 
| 
      
 79 
     | 
    
         
            +
                      return
         
     | 
| 
      
 80 
     | 
    
         
            +
                    end
         
     | 
| 
       82 
81 
     | 
    
         | 
| 
       83 
     | 
    
         
            -
             
     | 
| 
       84 
     | 
    
         
            -
             
     | 
| 
       85 
     | 
    
         
            -
             
     | 
| 
      
 82 
     | 
    
         
            +
                    if home?
         
     | 
| 
      
 83 
     | 
    
         
            +
                      list_from "", HOME_CACHE << '/' do |name|
         
     | 
| 
      
 84 
     | 
    
         
            +
                        say show_command_for name
         
     | 
| 
      
 85 
     | 
    
         
            +
                      end
         
     | 
| 
      
 86 
     | 
    
         
            +
                      puts ""
         
     | 
| 
      
 87 
     | 
    
         
            +
                      return
         
     | 
| 
       86 
88 
     | 
    
         
             
                    end
         
     | 
| 
       87 
89 
     | 
    
         
             
                  end
         
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
90 
     | 
    
         
             
                end
         
     | 
| 
       90 
91 
     | 
    
         | 
| 
       91 
92 
     | 
    
         
             
                desc "info" , "display information"
         
     | 
| 
       92 
93 
     | 
    
         
             
                def info
         
     | 
| 
       93 
     | 
    
         
            -
                   
     | 
| 
       94 
     | 
    
         
            -
                     
     | 
| 
       95 
     | 
    
         
            -
             
     | 
| 
       96 
     | 
    
         
            -
                     
     | 
| 
       97 
     | 
    
         
            -
             
     | 
| 
       98 
     | 
    
         
            -
             
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
       100 
     | 
    
         
            -
                     
     | 
| 
       101 
     | 
    
         
            -
             
     | 
| 
       102 
     | 
    
         
            -
                       
     | 
| 
      
 94 
     | 
    
         
            +
                  instructable do
         
     | 
| 
      
 95 
     | 
    
         
            +
                    if has_name?
         
     | 
| 
      
 96 
     | 
    
         
            +
                      say "connected to : #{get_name}"
         
     | 
| 
      
 97 
     | 
    
         
            +
                    else
         
     | 
| 
      
 98 
     | 
    
         
            +
                      say "connected to\ key: #{get_key}"
         
     | 
| 
      
 99 
     | 
    
         
            +
                    end
         
     | 
| 
      
 100 
     | 
    
         
            +
                    say "host: #{HOST}"
         
     | 
| 
      
 101 
     | 
    
         
            +
                    if File.exist? STATE
         
     | 
| 
      
 102 
     | 
    
         
            +
                      puts ""
         
     | 
| 
      
 103 
     | 
    
         
            +
                      `cat #{STATE}`.split("\n").each do |line|
         
     | 
| 
      
 104 
     | 
    
         
            +
                        say "#{line.chomp} ✔"
         
     | 
| 
      
 105 
     | 
    
         
            +
                      end
         
     | 
| 
      
 106 
     | 
    
         
            +
                      puts ""
         
     | 
| 
       103 
107 
     | 
    
         
             
                    end
         
     | 
| 
       104 
     | 
    
         
            -
                    puts ""
         
     | 
| 
       105 
108 
     | 
    
         
             
                  end
         
     | 
| 
      
 109 
     | 
    
         
            +
             
     | 
| 
       106 
110 
     | 
    
         
             
                end
         
     | 
| 
       107 
111 
     | 
    
         | 
| 
       108 
112 
     | 
    
         | 
| 
       109 
113 
     | 
    
         
             
                desc "do", "do an instruction"
         
     | 
| 
       110 
114 
     | 
    
         
             
                option :force
         
     | 
| 
       111 
115 
     | 
    
         
             
                def do name
         
     | 
| 
       112 
     | 
    
         
            -
                   
     | 
| 
       113 
     | 
    
         
            -
             
     | 
| 
       114 
     | 
    
         
            -
                     
     | 
| 
       115 
     | 
    
         
            -
             
     | 
| 
       116 
     | 
    
         
            -
             
     | 
| 
      
 116 
     | 
    
         
            +
                  instructable do
         
     | 
| 
      
 117 
     | 
    
         
            +
                    sync
         
     | 
| 
      
 118 
     | 
    
         
            +
                    if name.nil?
         
     | 
| 
      
 119 
     | 
    
         
            +
                      say "oops ! you need a name"
         
     | 
| 
      
 120 
     | 
    
         
            +
                      return
         
     | 
| 
      
 121 
     | 
    
         
            +
                    end
         
     | 
| 
       117 
122 
     | 
    
         | 
| 
       118 
     | 
    
         
            -
             
     | 
| 
       119 
     | 
    
         
            -
             
     | 
| 
       120 
     | 
    
         
            -
             
     | 
| 
       121 
     | 
    
         
            -
             
     | 
| 
       122 
     | 
    
         
            -
             
     | 
| 
       123 
     | 
    
         
            -
             
     | 
| 
       124 
     | 
    
         
            -
             
     | 
| 
       125 
     | 
    
         
            -
             
     | 
| 
       126 
     | 
    
         
            -
             
     | 
| 
       127 
     | 
    
         
            -
             
     | 
| 
       128 
     | 
    
         
            -
             
     | 
| 
       129 
     | 
    
         
            -
             
     | 
| 
       130 
     | 
    
         
            -
             
     | 
| 
      
 123 
     | 
    
         
            +
                    begin
         
     | 
| 
      
 124 
     | 
    
         
            +
                      CHECKED.clear
         
     | 
| 
      
 125 
     | 
    
         
            +
                      STACK.clear
         
     | 
| 
      
 126 
     | 
    
         
            +
                      load_from "Instructions", HOME_CACHE << "/" if home?
         
     | 
| 
      
 127 
     | 
    
         
            +
                      load_from "Projects", PROJECT_CACHE << "/" if project?
         
     | 
| 
      
 128 
     | 
    
         
            +
                      do_instruction name, STACK, options[:force]
         
     | 
| 
      
 129 
     | 
    
         
            +
                    rescue => e
         
     | 
| 
      
 130 
     | 
    
         
            +
             
     | 
| 
      
 131 
     | 
    
         
            +
                      say ""
         
     | 
| 
      
 132 
     | 
    
         
            +
                      say e.message
         
     | 
| 
      
 133 
     | 
    
         
            +
                      say ""
         
     | 
| 
      
 134 
     | 
    
         
            +
                      if e.message.include? "cant find"
         
     | 
| 
      
 135 
     | 
    
         
            +
                        instructions
         
     | 
| 
      
 136 
     | 
    
         
            +
                      end
         
     | 
| 
      
 137 
     | 
    
         
            +
                      say ""
         
     | 
| 
       131 
138 
     | 
    
         
             
                    end
         
     | 
| 
       132 
     | 
    
         
            -
                    say ""
         
     | 
| 
       133 
139 
     | 
    
         
             
                  end
         
     | 
| 
       134 
140 
     | 
    
         | 
| 
      
 141 
     | 
    
         
            +
             
     | 
| 
       135 
142 
     | 
    
         
             
                end
         
     | 
| 
       136 
143 
     | 
    
         | 
| 
       137 
144 
     | 
    
         
             
                desc "undo", "undo an instruction"
         
     | 
| 
       138 
145 
     | 
    
         
             
                option :force
         
     | 
| 
       139 
146 
     | 
    
         
             
                def undo name
         
     | 
| 
       140 
     | 
    
         
            -
                  sync
         
     | 
| 
       141 
     | 
    
         
            -
                  if name.nil?
         
     | 
| 
       142 
     | 
    
         
            -
                    say "oops ! you need a name"
         
     | 
| 
       143 
     | 
    
         
            -
                    return
         
     | 
| 
       144 
     | 
    
         
            -
                  end
         
     | 
| 
       145 
147 
     | 
    
         | 
| 
       146 
     | 
    
         
            -
                   
     | 
| 
       147 
     | 
    
         
            -
                     
     | 
| 
       148 
     | 
    
         
            -
                     
     | 
| 
       149 
     | 
    
         
            -
             
     | 
| 
       150 
     | 
    
         
            -
             
     | 
| 
       151 
     | 
    
         
            -
                     
     | 
| 
       152 
     | 
    
         
            -
             
     | 
| 
       153 
     | 
    
         
            -
             
     | 
| 
       154 
     | 
    
         
            -
             
     | 
| 
       155 
     | 
    
         
            -
             
     | 
| 
       156 
     | 
    
         
            -
             
     | 
| 
       157 
     | 
    
         
            -
             
     | 
| 
       158 
     | 
    
         
            -
                       
     | 
| 
      
 148 
     | 
    
         
            +
                  instructable do
         
     | 
| 
      
 149 
     | 
    
         
            +
                    sync
         
     | 
| 
      
 150 
     | 
    
         
            +
                    if name.nil?
         
     | 
| 
      
 151 
     | 
    
         
            +
                      say "oops ! you need a name"
         
     | 
| 
      
 152 
     | 
    
         
            +
                      return
         
     | 
| 
      
 153 
     | 
    
         
            +
                    end
         
     | 
| 
      
 154 
     | 
    
         
            +
             
     | 
| 
      
 155 
     | 
    
         
            +
                    begin
         
     | 
| 
      
 156 
     | 
    
         
            +
                      CHECKED.clear
         
     | 
| 
      
 157 
     | 
    
         
            +
                      STACK.clear
         
     | 
| 
      
 158 
     | 
    
         
            +
                      load_from "Instructions", HOME_CACHE << "/" if home?
         
     | 
| 
      
 159 
     | 
    
         
            +
                      load_from "Projects", PROJECT_CACHE << "/" if project?
         
     | 
| 
      
 160 
     | 
    
         
            +
                      undo_instruction name, STACK, options[:force]
         
     | 
| 
      
 161 
     | 
    
         
            +
                    rescue => e
         
     | 
| 
      
 162 
     | 
    
         
            +
             
     | 
| 
      
 163 
     | 
    
         
            +
                      say ""
         
     | 
| 
      
 164 
     | 
    
         
            +
                      say e.message
         
     | 
| 
      
 165 
     | 
    
         
            +
                      say ""
         
     | 
| 
      
 166 
     | 
    
         
            +
                      if e.message.include? "cant find"
         
     | 
| 
      
 167 
     | 
    
         
            +
                        instructions
         
     | 
| 
      
 168 
     | 
    
         
            +
                      end
         
     | 
| 
      
 169 
     | 
    
         
            +
                      say ""
         
     | 
| 
       159 
170 
     | 
    
         
             
                    end
         
     | 
| 
       160 
     | 
    
         
            -
                    say ""
         
     | 
| 
       161 
171 
     | 
    
         
             
                  end
         
     | 
| 
       162 
172 
     | 
    
         | 
| 
       163 
173 
     | 
    
         
             
                end
         
     | 
| 
         @@ -167,6 +177,15 @@ module InstructionsList 
     | 
|
| 
       167 
177 
     | 
    
         | 
| 
       168 
178 
     | 
    
         
             
                no_tasks do
         
     | 
| 
       169 
179 
     | 
    
         | 
| 
      
 180 
     | 
    
         
            +
             
     | 
| 
      
 181 
     | 
    
         
            +
                  def instructable
         
     | 
| 
      
 182 
     | 
    
         
            +
                    if project? || home?
         
     | 
| 
      
 183 
     | 
    
         
            +
                      yield
         
     | 
| 
      
 184 
     | 
    
         
            +
                    else
         
     | 
| 
      
 185 
     | 
    
         
            +
                      say "Oooops! #{Dir.pwd} is not instructable!"
         
     | 
| 
      
 186 
     | 
    
         
            +
                    end
         
     | 
| 
      
 187 
     | 
    
         
            +
                  end
         
     | 
| 
      
 188 
     | 
    
         
            +
             
     | 
| 
       170 
189 
     | 
    
         
             
                  def get_key
         
     | 
| 
       171 
190 
     | 
    
         
             
            	      return "Not connected!" unless File.exists? KEY_PATH
         
     | 
| 
       172 
191 
     | 
    
         
             
                    File.read(KEY_PATH).chomp
         
     |