m9sh 0.2.2 → 0.2.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
  SHA256:
3
- metadata.gz: 58b74eb111bd5e0edbc12f4448c6ddfde0ad6b6cacdeadbe604c9ca0fa1226d3
4
- data.tar.gz: f21c715a96ce2517b50f3da13bde38fe550226f97b10d0f2d169a0b705a5f885
3
+ metadata.gz: b2943f1ea814ee67959d6641c70faafff3cd1679436893f0e5e6bd0346a87bd1
4
+ data.tar.gz: 19596194b09be430dab2ece4179bf7a7adb748f9e47016dd4e74b5420eac087a
5
5
  SHA512:
6
- metadata.gz: c30dfae60aa915c7acb4a9b38b4f665491bb9e9d368e52ffbc9050c57e175f529dad3efd900d85b4193ea56818d248c15ee233a8c154e8fefd1b426c564d4d05
7
- data.tar.gz: 54121f63d5f536988a55ac5033e6f5632f619e1be2380ec5922402010879fa2f5ca1e0349160bc1719fee176c07cd5982b7f6487f8c18cc3efad64ae1846d36c
6
+ metadata.gz: 6082841e10731ac6b1f8524a3e8c2c3f6ea402a385d543c180bbee82308778a393b04b87569792689c7ab49d383e756fdcf40bc15586571c2482a60402a040c9
7
+ data.tar.gz: b5ddcde073cd21ab9956c713eba54582ec28adbf1cb6a9cec76410e571dccd3575ccfa351043c4e1798bc3605b4b567770e2fd2fdcbe43a5f863e0115af49fc9
@@ -107,7 +107,8 @@ module M9sh
107
107
  end
108
108
 
109
109
  def copy_file(source_file, namespace, components_path, javascript_path, force)
110
- source_path = File.join(@root_path, source_file)
110
+ # Find the source file - first try gem installation, then local dev
111
+ source_path = find_source_file(source_file)
111
112
 
112
113
  unless File.exist?(source_path)
113
114
  return { success: false, error: "Source file not found: #{source_file}" }
@@ -179,5 +180,20 @@ module M9sh
179
180
  def sync_all(options = {})
180
181
  generate_all(options.merge(force: true))
181
182
  end
183
+
184
+ # Find source file in gem directory or local development directory
185
+ def find_source_file(relative_path)
186
+ # First, try the gem installation directory
187
+ begin
188
+ spec = Gem::Specification.find_by_name('m9sh')
189
+ gem_path = File.join(spec.gem_dir, relative_path)
190
+ return gem_path if File.exist?(gem_path)
191
+ rescue Gem::MissingSpecError
192
+ # Gem not installed, fall through to local path
193
+ end
194
+
195
+ # Fall back to local development path
196
+ File.join(@root_path, relative_path)
197
+ end
182
198
  end
183
199
  end
data/lib/m9sh/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module M9sh
4
- VERSION = "0.2.2"
4
+ VERSION = "0.2.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: m9sh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Urbanski