instrumental-components 0.1.3 → 0.1.32

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
  SHA256:
3
- metadata.gz: b092b9fca8b7f731aa1f239b408f7a02d6d48397a9d321f2078c684ba7957958
4
- data.tar.gz: ede170f09e2d0adf91b7cd677f1f5c8392b4871f18026f53945b517c1f27aa85
3
+ metadata.gz: b91fde31945f313b326f37ab1e9a389ac04e4c0011ee6820a6801219d74fb0d1
4
+ data.tar.gz: a2b3ed177b1a2f8e5ffac6aaf6f7cba990e7b5eb4c1bf7ad8f7de50886f31e20
5
5
  SHA512:
6
- metadata.gz: e8aefe9b530f390dff6a48074d049cc354dfee1540d6ac8dea0d646d72da1b1d4483efe5523e91ee56d70c9e9005b1f3de5e3a6d19f7776d6fcb0ef234f0a029
7
- data.tar.gz: 25080945bc2f8afe3758231fe21243c2dc794381979eb56b160e68cbd92f8f847d79383ad4ca17c4e91eabf5e48aadc6aef48d4c5cc277ed27a1e534c2471c1c
6
+ metadata.gz: 53aa3cbb0722c5916fb4437daac97a0ad53944a2b340e63f3a2c036234370b95a9ed9eb2b3e336722f922578fa3336f55be6afffa0f063a70dab399518ea0912
7
+ data.tar.gz: f4e90aabce528ea02e1352c3f920365f2ba604867a0f944b5fbc2df78d61cdb034781b8b82ac4d8d4c960cc1e109693b7d45d8b7132c04bf57d5b3662a51da4d
@@ -58,12 +58,15 @@ module InstrumentalComponents
58
58
  private
59
59
 
60
60
  def updating?
61
- gemfile_has_gem? && gemfile_lock_has_gem?
61
+ # Only consider it updating if the gem is in the current project's Gemfile
62
+ # and Gemfile.lock, not just installed system-wide
63
+ gemfile_has_gem? && gemfile_lock_has_gem? && File.exist?('Gemfile.lock')
62
64
  end
63
65
 
64
66
  def gemfile_has_gem?
65
67
  return false unless File.exist?('Gemfile')
66
- File.read('Gemfile').include?("gem 'instrumental-components-library'")
68
+ # Use a more precise regex to match the gem declaration
69
+ File.read('Gemfile').match?(/^\s*gem\s+['"]instrumental-components-library['"]/)
67
70
  end
68
71
 
69
72
  def gemfile_lock_has_gem?
@@ -127,12 +130,11 @@ module InstrumentalComponents
127
130
 
128
131
  gemfile_content = File.read(gemfile_path)
129
132
 
130
- unless gemfile_content.include?("gem 'instrumental-components-library'")
133
+ # Check if the gem is already in any development group
134
+ unless gemfile_content.match?(/^\s*gem\s+['"]instrumental-components-library['"]/)
131
135
  if gemfile_content.include?("group :development")
132
- # Add to existing development group
133
- gemfile_content.gsub!(/group :development\s+do/) do |match|
134
- "#{match}\n gem 'instrumental-components-library'"
135
- end
136
+ # Find the first development group and add the gem after the 'do'
137
+ gemfile_content.sub!(/(group :development\s+do)/, "\\1\n gem 'instrumental-components-library'")
136
138
  else
137
139
  # Create new development group
138
140
  gemfile_content += "\n\ngroup :development do\n gem 'instrumental-components-library'\nend\n"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instrumental-components
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Casel