arli 1.0.0 → 1.0.1
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/Rakefile +2 -2
- data/lib/arli/actions/dir_name.rb +20 -2
- data/lib/arli/cli/runner.rb +1 -5
- data/lib/arli/helpers/output.rb +1 -0
- data/lib/arli/library/single_version.rb +12 -4
- data/lib/arli/lock/formats/template/Arlifile.cmake.erb +2 -0
- data/lib/arli/lock/formats/template/cmake_renderer.rb +4 -0
- data/lib/arli/lock/formats/yaml.rb +1 -1
- data/lib/arli/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e66d1d140d209c8afbc79e983511356099ba62a8
         | 
| 4 | 
            +
              data.tar.gz: 230a68d260099f99f18a36b5e942fe290e5051ef
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b6845831dcc2b447ffff45103fab7b620c616564b1df6a5a0e5b44cf7b0de5320a1e895bfe92b55a6357938b1fe6542e0e18039f730dff2de9607d4319a2d2da
         | 
| 7 | 
            +
              data.tar.gz: 5b1264568dd1e1c5f3716d66a724a4fc29edc42ed33b079072700a86313ee493e6f764fa029be94ff24f0d8a9b1c83442d615faebfeacf1caf58f17c93187f5e
         | 
    
        data/Rakefile
    CHANGED
    
    | @@ -8,10 +8,10 @@ def shell(*args) | |
| 8 8 | 
             
            end
         | 
| 9 9 |  | 
| 10 10 | 
             
            task :clean do 
         | 
| 11 | 
            -
              shell('rm - | 
| 11 | 
            +
              shell('rm -rf pkg/ tmp/ coverage/' )
         | 
| 12 12 | 
             
            end
         | 
| 13 13 |  | 
| 14 | 
            -
            task :permissions do 
         | 
| 14 | 
            +
            task :permissions => [ :clean ] do 
         | 
| 15 15 | 
             
              shell("chmod -v o+r,g+r * */* */*/* */*/*/* */*/*/*/* */*/*/*/*/*")
         | 
| 16 16 | 
             
              shell("find . -type d -exec chmod o+x,g+x {} \\;")
         | 
| 17 17 | 
             
            end
         | 
| @@ -16,7 +16,6 @@ module Arli | |
| 16 16 | 
             
                  attr_accessor :sources, :headers
         | 
| 17 17 |  | 
| 18 18 | 
             
                  def execute
         | 
| 19 | 
            -
             | 
| 20 19 | 
             
                    find_source_files
         | 
| 21 20 |  | 
| 22 21 | 
             
                    # so "dir" is the 'Adafruit_Unified_Sensor'
         | 
| @@ -33,13 +32,24 @@ module Arli | |
| 33 32 |  | 
| 34 33 | 
             
                      set_canonical_dir!(candidate)
         | 
| 35 34 | 
             
                    end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                    if if_no(sources) && if_have(headers)
         | 
| 37 | 
            +
                      library.headers_only = true
         | 
| 38 | 
            +
                    end
         | 
| 36 39 | 
             
                  end
         | 
| 37 40 |  | 
| 38 41 | 
             
                  private
         | 
| 39 42 |  | 
| 40 43 | 
             
                  def set_canonical_dir!(canonical_dir)
         | 
| 41 44 | 
             
                    if canonical_dir && canonical_dir != dir
         | 
| 42 | 
            -
                       | 
| 45 | 
            +
                      # if they are match case insensitively, we may be
         | 
| 46 | 
            +
                      # on a mac where these are considered the same
         | 
| 47 | 
            +
                      if dir =~ /^#{canonical_dir}$/i
         | 
| 48 | 
            +
                        mv(dir, canonical_dir + '.temp')
         | 
| 49 | 
            +
                        mv(canonical_dir + '.temp', canonical_dir)
         | 
| 50 | 
            +
                      else
         | 
| 51 | 
            +
                        mv(dir, canonical_dir)
         | 
| 52 | 
            +
                      end
         | 
| 43 53 | 
             
                      library.canonical_dir = canonical_dir
         | 
| 44 54 | 
             
                    else
         | 
| 45 55 | 
             
                      library.canonical_dir = dir
         | 
| @@ -57,6 +67,14 @@ module Arli | |
| 57 67 | 
             
                    end
         | 
| 58 68 | 
             
                  end
         | 
| 59 69 |  | 
| 70 | 
            +
                  def if_no(file_names)
         | 
| 71 | 
            +
                    file_names.nil? || file_names.empty?
         | 
| 72 | 
            +
                  end
         | 
| 73 | 
            +
             | 
| 74 | 
            +
                  def if_have(file_names)
         | 
| 75 | 
            +
                    file_names && !file_names.empty?
         | 
| 76 | 
            +
                  end
         | 
| 77 | 
            +
             | 
| 60 78 | 
             
                  def find_source_files
         | 
| 61 79 | 
             
                    Dir.chdir(dir) do
         | 
| 62 80 | 
             
                      self.sources = files_with_extension('**.{cpp,c}')
         | 
    
        data/lib/arli/cli/runner.rb
    CHANGED
    
    | @@ -19,11 +19,7 @@ module Arli | |
| 19 19 | 
             
                      Arli::CLI::App.new(@argv).start
         | 
| 20 20 | 
             
                      print_debug_info
         | 
| 21 21 | 
             
                      0
         | 
| 22 | 
            -
                    rescue StandardError | 
| 23 | 
            -
                      b = e.backtrace
         | 
| 24 | 
            -
                      @stderr.puts("#{b.shift.bold}:\n") if Arli.config.debug
         | 
| 25 | 
            -
                      @stderr.puts("#{e.message.bold.red} (#{e.class.name.yellow})")
         | 
| 26 | 
            -
                      @stderr.puts(b.map { |s| "\tfrom #{s}" }.join("\n").red)
         | 
| 22 | 
            +
                    rescue StandardError
         | 
| 27 23 | 
             
                      1
         | 
| 28 24 | 
             
                    rescue SystemExit => e
         | 
| 29 25 | 
             
                      e.status
         | 
    
        data/lib/arli/helpers/output.rb
    CHANGED
    
    
| @@ -12,12 +12,14 @@ module Arli | |
| 12 12 | 
             
                  attr_accessor :lib,
         | 
| 13 13 | 
             
                                :lib_dir,
         | 
| 14 14 | 
             
                                :canonical_dir,
         | 
| 15 | 
            -
                                :config
         | 
| 15 | 
            +
                                :config,
         | 
| 16 | 
            +
                                :headers_only
         | 
| 16 17 |  | 
| 17 18 | 
             
                  def initialize(lib, config: Arli.config)
         | 
| 18 | 
            -
                    self.lib | 
| 19 | 
            -
                    self.config | 
| 20 | 
            -
                    self.lib_dir | 
| 19 | 
            +
                    self.lib          = lib
         | 
| 20 | 
            +
                    self.config       = config
         | 
| 21 | 
            +
                    self.lib_dir      = lib.name.gsub(/ /, '_')
         | 
| 22 | 
            +
                    self.headers_only = false
         | 
| 21 23 | 
             
                  end
         | 
| 22 24 |  | 
| 23 25 | 
             
                  def install
         | 
| @@ -52,6 +54,12 @@ module Arli | |
| 52 54 | 
             
                    Dir.exist?(path)
         | 
| 53 55 | 
             
                  end
         | 
| 54 56 |  | 
| 57 | 
            +
                  def inspect
         | 
| 58 | 
            +
                    <<-EOF
         | 
| 59 | 
            +
            Library: #{lib.name} (#{lib.url}), only headers? #{headers_only ? 'YES': 'NO'}
         | 
| 60 | 
            +
                    EOF
         | 
| 61 | 
            +
                  end
         | 
| 62 | 
            +
             | 
| 55 63 | 
             
                  def method_missing(method, *args, &block)
         | 
| 56 64 | 
             
                    if lib && lib.respond_to?(method)
         | 
| 57 65 | 
             
                      lib.send(method, *args, &block)
         | 
| @@ -25,6 +25,8 @@ set(ARLI_ARDUINO_LIBS <% arduino_libraries.each do |library| %> | |
| 25 25 |  | 
| 26 26 | 
             
            <% device_libraries_headers_only.each do |library| %>
         | 
| 27 27 | 
             
            set(<%= library.name %>_ONLY_HEADER yes)<% end %>
         | 
| 28 | 
            +
            <% custom_libraries_headers_only.each do |library| %>
         | 
| 29 | 
            +
            set(<%= library.canonical_dir %>_ONLY_HEADER yes)<% end %>
         | 
| 28 30 |  | 
| 29 31 | 
             
            include(Arli)
         | 
| 30 32 |  | 
| @@ -54,6 +54,10 @@ module Arli | |
| 54 54 | 
             
                        Array(hardware_libraries + arduino_libraries).flatten
         | 
| 55 55 | 
             
                      end
         | 
| 56 56 |  | 
| 57 | 
            +
                      def custom_libraries_headers_only
         | 
| 58 | 
            +
                        libraries.select { |l| l.headers_only } || []
         | 
| 59 | 
            +
                      end
         | 
| 60 | 
            +
             | 
| 57 61 | 
             
                      def device_libraries_headers_only
         | 
| 58 62 | 
             
                        device_libraries.select { |l| l.headers_only } || []
         | 
| 59 63 | 
             
                      end
         | 
    
        data/lib/arli/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: arli
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1.0. | 
| 4 | 
            +
              version: 1.0.1
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Konstantin Gredeskoul
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2017-12- | 
| 11 | 
            +
            date: 2017-12-25 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: arduino-library
         |