inkmake 0.1.5 → 0.1.6
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/lib/inkmake.rb +35 -28
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e8f974d5799a2dad944fc34bc8ff9ee6357493f19166ccdf8baa93db3e76dac3
         | 
| 4 | 
            +
              data.tar.gz: 03777d34d7aa798e57cb6f7a3ea55300284157c424636aa551ee6502eb9f4ddd
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: ddf8cdeefbfbf3b7f3aff2cfcebfb48cc8f6916d96f56794fabec3470e9e382fa12eeb65c14a016aeb0c12406542ba98255d62c8c677979166f531abcf1cd5c7
         | 
| 7 | 
            +
              data.tar.gz: f68bb1b2b9229aee3d8f64038dfcccf5ea615b2770115419e049741c9ce31b77ceefca1801afef005feae83f3a683ee1ff4f73d5db67d48827ded5754289b0cf
         | 
    
        data/lib/inkmake.rb
    CHANGED
    
    | @@ -139,8 +139,26 @@ class Inkmake | |
| 139 139 | 
             
                  end
         | 
| 140 140 | 
             
                end
         | 
| 141 141 |  | 
| 142 | 
            -
                def  | 
| 143 | 
            -
                   | 
| 142 | 
            +
                def response
         | 
| 143 | 
            +
                  if @inkscape_version == 0
         | 
| 144 | 
            +
                    o = @out.getc
         | 
| 145 | 
            +
                    if o == ">"
         | 
| 146 | 
            +
                      puts "1> #{o}" if Inkmake.verbose
         | 
| 147 | 
            +
                      return :prompt;
         | 
| 148 | 
            +
                    end
         | 
| 149 | 
            +
                  else
         | 
| 150 | 
            +
                    o = @out.getc + @out.getc
         | 
| 151 | 
            +
                    if o == "> "
         | 
| 152 | 
            +
                      puts "1> #{o}" if Inkmake.verbose
         | 
| 153 | 
            +
                      return :prompt;
         | 
| 154 | 
            +
                    end
         | 
| 155 | 
            +
                  end
         | 
| 156 | 
            +
                  o = o + @out.readline
         | 
| 157 | 
            +
                  puts "2> '#{o}'" if Inkmake.verbose
         | 
| 158 | 
            +
                  o
         | 
| 159 | 
            +
                end
         | 
| 160 | 
            +
             | 
| 161 | 
            +
                def wait_prompt
         | 
| 144 162 | 
             
                  loop do
         | 
| 145 163 | 
             
                    case response
         | 
| 146 164 | 
             
                    when :prompt then break
         | 
| @@ -148,6 +166,11 @@ class Inkmake | |
| 148 166 | 
             
                  end
         | 
| 149 167 | 
             
                end
         | 
| 150 168 |  | 
| 169 | 
            +
                def open_shell
         | 
| 170 | 
            +
                  @in, @out = open(["--shell"])
         | 
| 171 | 
            +
                  wait_prompt
         | 
| 172 | 
            +
                end
         | 
| 173 | 
            +
             | 
| 151 174 | 
             
                def command0(args)
         | 
| 152 175 | 
             
                  c = args.collect do |key, value|
         | 
| 153 176 | 
             
                    if value
         | 
| @@ -174,25 +197,6 @@ class Inkmake | |
| 174 197 | 
             
                  @in.flush
         | 
| 175 198 | 
             
                end
         | 
| 176 199 |  | 
| 177 | 
            -
                def response
         | 
| 178 | 
            -
                  if @inkscape_version == 0
         | 
| 179 | 
            -
                    o = @out.read(1)
         | 
| 180 | 
            -
                    if o == ">"
         | 
| 181 | 
            -
                      puts "1> #{o}" if Inkmake.verbose
         | 
| 182 | 
            -
                      return :prompt;
         | 
| 183 | 
            -
                    end
         | 
| 184 | 
            -
                  else
         | 
| 185 | 
            -
                    o = @out.read(2)
         | 
| 186 | 
            -
                    if o == "> "
         | 
| 187 | 
            -
                      puts "1> #{o}" if Inkmake.verbose
         | 
| 188 | 
            -
                      return :prompt;
         | 
| 189 | 
            -
                    end
         | 
| 190 | 
            -
                  end
         | 
| 191 | 
            -
                  o = o + @out.readline
         | 
| 192 | 
            -
                  puts "2> #{o}" if Inkmake.verbose
         | 
| 193 | 
            -
                  o
         | 
| 194 | 
            -
                end
         | 
| 195 | 
            -
             | 
| 196 200 | 
             
                def probe_inkscape_version
         | 
| 197 201 | 
             
                  _in, out = open(["--version"])
         | 
| 198 202 | 
             
                  version = 0
         | 
| @@ -278,7 +282,7 @@ class Inkmake | |
| 278 282 | 
             
                  end
         | 
| 279 283 | 
             
                  c.each do |a|
         | 
| 280 284 | 
             
                    command1([a])
         | 
| 281 | 
            -
                     | 
| 285 | 
            +
                    wait_prompt
         | 
| 282 286 | 
             
                  end
         | 
| 283 287 |  | 
| 284 288 | 
             
                  command1([["export-do"]])
         | 
| @@ -292,7 +296,7 @@ class Inkmake | |
| 292 296 | 
             
                    end
         | 
| 293 297 | 
             
                  end
         | 
| 294 298 | 
             
                  command1([["file-close"]])
         | 
| 295 | 
            -
                   | 
| 299 | 
            +
                  wait_prompt
         | 
| 296 300 |  | 
| 297 301 | 
             
                  [width, height]
         | 
| 298 302 | 
             
                end
         | 
| @@ -314,7 +318,7 @@ class Inkmake | |
| 314 318 | 
             
                    })
         | 
| 315 319 | 
             
                  else
         | 
| 316 320 | 
             
                    command1([["file-open", file]])
         | 
| 317 | 
            -
                     | 
| 321 | 
            +
                    wait_prompt
         | 
| 318 322 | 
             
                    command1([["query-all", file]])
         | 
| 319 323 | 
             
                  end
         | 
| 320 324 | 
             
                  loop do
         | 
| @@ -325,7 +329,7 @@ class Inkmake | |
| 325 329 | 
             
                  end
         | 
| 326 330 | 
             
                  if @inkscape_version == 1 then
         | 
| 327 331 | 
             
                    command1([["file-close", file]])
         | 
| 328 | 
            -
                     | 
| 332 | 
            +
                    wait_prompt
         | 
| 329 333 | 
             
                  end
         | 
| 330 334 | 
             
                  ids
         | 
| 331 335 | 
             
                end
         | 
| @@ -360,7 +364,9 @@ class Inkmake | |
| 360 364 | 
             
                    (["/Applications/Inkscape.app/Contents/MacOS/inkscape",
         | 
| 361 365 | 
             
                      "/Applications/Inkscape.app/Contents/Resources/bin/inkscape",
         | 
| 362 366 | 
             
                      'c:\Program Files\Inkscape\inkscape.exe',
         | 
| 363 | 
            -
                      'c:\Program Files | 
| 367 | 
            +
                      'c:\Program Files\Inkscape\bin\inkscape.exe',
         | 
| 368 | 
            +
                      'c:\Program Files (x86)\Inkscape\inkscape.exe',
         | 
| 369 | 
            +
                      'c:\Program Files (x86)\Inkscape\bin\inkscape.exe'] +
         | 
| 364 370 | 
             
                      (ENV['PATH'].split(':').map {|p| File.join(p, "inkscape")}))
         | 
| 365 371 | 
             
                    .select do |path|
         | 
| 366 372 | 
             
                      File.exists? path
         | 
| @@ -453,10 +459,11 @@ class Inkmake | |
| 453 459 |  | 
| 454 460 | 
             
                def parse_split_line(line)
         | 
| 455 461 | 
             
                  # changed CSV API in ruby 1.9
         | 
| 462 | 
            +
                  # - [nil] to remove empty fields
         | 
| 456 463 | 
             
                  if RUBY_VERSION.start_with? "1.8"
         | 
| 457 | 
            -
                    CSV::parse_line(line, fs = " ")
         | 
| 464 | 
            +
                    CSV::parse_line(line, fs = " ") - [nil]
         | 
| 458 465 | 
             
                  else
         | 
| 459 | 
            -
                    CSV::parse_line(line, **{:col_sep => " "})
         | 
| 466 | 
            +
                    CSV::parse_line(line, **{:col_sep => " "}) - [nil]
         | 
| 460 467 | 
             
                  end
         | 
| 461 468 | 
             
                end
         | 
| 462 469 |  | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: inkmake
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.1. | 
| 4 | 
            +
              version: 0.1.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Mattias Wadman
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2021-08-30 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: 
         | 
| 14 14 | 
             
            email: mattias.wadman@gmail.com
         |