arduino-library 0.5.1 → 0.5.3

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
  SHA1:
3
- metadata.gz: 7683ee09e7e2aeb8e0182039e308d545b8a7507b
4
- data.tar.gz: 2fc1836d9d41d2a2aa8b3a00b956ddd297526e80
3
+ metadata.gz: 6691a2146d6bc9c2ab4a239df35cbe6c84bf7292
4
+ data.tar.gz: e84d26718c57e606b13957df6b7af818a24a8c6b
5
5
  SHA512:
6
- metadata.gz: 0c96fd33e55a9c104c7dc5a706a58a62875ce02d054baaf368cb741f9d58f6fa00ae7bc22920e4ac8d96892ded640b74783f5288b2716c3c368ddc7793584c48
7
- data.tar.gz: cb58a752b6f5ac06ecd343ebb8e4ab372f218c894aeab3a2e5d75904309424b1266f0ddd42a7b592387a601528a072ef862baec02807e7ba2eef6f7edf94b768
6
+ metadata.gz: 64e2c1775881a54e41f4ab4a8df24e1586c5d104e252cd28464f11596746bca3daffe79b5b466174e3b88d1fbc274f5ae2768ba3499ca2aa5e5b75e8b8779ef1
7
+ data.tar.gz: c64b0539981bc60d343de65db3d479da4815c8443ee532821d67f3c30b966d71722d5e0e32c61e75c21d6faabded3bd6e7d3c221815e9062b8d3063550876d42
@@ -41,7 +41,11 @@ module Arduino
41
41
  end
42
42
 
43
43
  def <=>(another)
44
- self.version_to_i <=> another.version_to_i
44
+ if self.name == another.name
45
+ self.version_to_i <=> another.version_to_i
46
+ else
47
+ self.name <=> another.name
48
+ end
45
49
  end
46
50
 
47
51
  # Class Methods
@@ -124,8 +128,11 @@ module Arduino
124
128
  if opts
125
129
  if SEARCHABLE_FIELDS.any?{ |field| opts[field] }
126
130
  results = search(**opts)
127
- raise "Too many items matched — #{results.size}" if results.size > 1
128
- results ? results.first : nil
131
+ if results
132
+ results.sort.last
133
+ else
134
+ nil
135
+ end
129
136
  else
130
137
  from_hash(opts)
131
138
  end
@@ -1,6 +1,6 @@
1
1
  module Arduino
2
2
  module Library
3
- VERSION = '0.5.1'
3
+ VERSION = '0.5.3'
4
4
  DESCRIPTION = <<-eof
5
5
  This library provides a convenient ruby API for representation of an Arduino Library specification, including field and type validation, reading and writing the library.properties file, as well as downloading the official database of Arduino libraries, and offering a highly advanced searching functionality. This gem only offers Ruby API, but for command line usage please checkout the gem called "arli" — Arduino Library Dependency Manager that uses this library behind the scenes.
6
6
  eof
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arduino-library
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Gredeskoul