shoes-package 4.0.0.pre8 → 4.0.0.pre9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9b5bb9d7084b21501f365f96292ee3849ac0c120
4
- data.tar.gz: a469da43c74cdd6c99401bf9ad7afe65c11ed479
3
+ metadata.gz: 905de2fecc90976b6949e60f976a575c010c9008
4
+ data.tar.gz: 5da98924922544603b1c736413b2696dd924f5cd
5
5
  SHA512:
6
- metadata.gz: af95d9171a37c398c5476e1111574ac90ce5987a25fe7b8e642bc1605ff9f0ca445d0813b003455d2d067634d958844cc5e01adc3875c96e966b6ac319f6f1e2
7
- data.tar.gz: c0fba6e9818d936531ce915a485f2a1296ff5f46c08aa6b121978dc8be8b43deed56b29c8ba91b4b7cf9a4f9d3065862db2b79b525ba7fe0f06433ba3e5d9900
6
+ metadata.gz: c9659f7fe6a19cde5a1ae14e2bf9881dfb68458ace0b2bf4e67c3bc53cc2ddae93e3209daa47395d1cf6a994283f76939885566659c9d61c89fd4902a9c54895
7
+ data.tar.gz: 999aaa14cfbbf3624c2f82c4f059a23f38a3fff5c2a582ee791a3df82554114272a41bc538bf71dbcab651285ee52f8425ebe00764faea899251a9f6fc6c14e9
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+ class Shoes
3
+ module Package
4
+ def self.create_packager(config, wrapper)
5
+ require 'furoshiki/jar'
6
+ require 'furoshiki/jar_app'
7
+
8
+ case wrapper
9
+ when 'jar'
10
+ ::Furoshiki::Jar.new(config)
11
+ when 'app'
12
+ ::Furoshiki::JarApp.new(config)
13
+ else
14
+ abort "shoes: Don't know how to make #{config.backend}:#{wrapper} packages"
15
+ end
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'bundler'
2
3
  require 'pathname'
3
4
  require 'yaml'
@@ -17,7 +18,11 @@ class Shoes
17
18
  module Configuration
18
19
  extend ::Furoshiki::Util
19
20
 
20
- JAR_APP_TEMPLATE_URL = 'https://s3.amazonaws.com/net.wasnotrice.shoes/wrappers/shoes-app-template-0.0.2.zip'.freeze
21
+ def backend
22
+ "swt"
23
+ end
24
+
25
+ JAR_APP_TEMPLATE_URL = 'https://s3.amazonaws.com/net.wasnotrice.shoes/wrappers/shoes-app-template-0.0.2.zip'
21
26
 
22
27
  # Convenience method for loading config from a file. Note that you
23
28
  # can pass four kinds of paths to the loader. Given the following
@@ -74,6 +79,7 @@ class Shoes
74
79
  config = YAML.safe_load(file.read, [Symbol])
75
80
  config[:working_dir] = dir
76
81
  config[:gems] = merge_gems(base_config, config)
82
+ config[:gems] << "shoes-swt"
77
83
  create(config)
78
84
  end
79
85
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  class Shoes
4
4
  module Package
5
- VERSION = "4.0.0.pre8"
5
+ VERSION = "4.0.0.pre9"
6
6
  end
7
7
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'warbler'
2
3
  require 'warbler/traits'
3
4
  require 'warbler/traits/furoshiki'
@@ -28,8 +29,15 @@ module Warbler
28
29
  [Traits::Jar, Traits::NoGemspec].include? trait
29
30
  end
30
31
 
32
+ INIT_CONTENTS = <<~EOS
33
+ require 'shoes'
34
+ require 'shoes/swt'
35
+
36
+ Shoes::Swt.initialize_backend
37
+ EOS
38
+
31
39
  def after_configure
32
- config.init_contents << StringIO.new("require 'shoes'\nrequire 'shoes/swt'\nShoes::Swt.initialize_backend\n")
40
+ config.init_contents << StringIO.new(INIT_CONTENTS)
33
41
  end
34
42
 
35
43
  def update_archive(jar)
@@ -37,6 +45,21 @@ module Warbler
37
45
  add_main_rb(jar, apply_pathmaps(config, default_executable, :application))
38
46
  end
39
47
 
48
+ def add_main_rb(jar, bin_path, _params = nil)
49
+ main = <<~EOS
50
+ begin
51
+ load '#{bin_path}'
52
+ rescue Java::OrgEclipseSwt::SWTException => e
53
+ if e.message == "Invalid thread access"
54
+ puts ""
55
+ puts "Ooops, you'll need to pass -XstartOnFirstThread when you start your jar!"
56
+ end
57
+ end
58
+ EOS
59
+
60
+ jar.files['META-INF/main.rb'] = StringIO.new(main)
61
+ end
62
+
40
63
  # Uses the `@config.run` if it exists. Otherwise, looks in the
41
64
  # application's `bin` directory for an executable with the same name as
42
65
  # the jar. If this also fails, defaults to the first executable (alphabetically) in the
metadata CHANGED
@@ -1,21 +1,21 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shoes-package
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.pre8
4
+ version: 4.0.0.pre9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Team Shoes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-28 00:00:00.000000000 Z
11
+ date: 2017-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 4.0.0.pre8
18
+ version: 4.0.0.pre9
19
19
  name: shoes-core
20
20
  prerelease: false
21
21
  type: :runtime
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0.pre8
26
+ version: 4.0.0.pre9
27
27
  - !ruby/object:Gem::Dependency
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
@@ -59,9 +59,8 @@ executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - lib/shoes/package.rb
62
63
  - lib/shoes/package/configuration.rb
63
- - lib/shoes/package/jar.rb
64
- - lib/shoes/package/jar_app.rb
65
64
  - lib/shoes/package/version.rb
66
65
  - lib/warbler/traits/shoes.rb
67
66
  homepage: https://github.com/shoes/shoes4
@@ -1,17 +0,0 @@
1
- require 'forwardable'
2
- require 'furoshiki/jar'
3
-
4
- class Shoes
5
- module Package
6
- class Jar
7
- extend Forwardable
8
-
9
- def_delegators :@packager, :package, :default_dir, :filename
10
-
11
- def initialize(config)
12
- config.gems << 'shoes-swt'
13
- @packager = Furoshiki::Jar.new(config)
14
- end
15
- end
16
- end
17
- end
@@ -1,18 +0,0 @@
1
- require 'forwardable'
2
- require 'furoshiki/jar_app'
3
-
4
- class Shoes
5
- module Package
6
- class JarApp
7
- extend Forwardable
8
-
9
- def_delegators :@packager, :package, :default_package_dir, :cache_dir,
10
- :remote_template_url, :template_path
11
-
12
- def initialize(config)
13
- config.gems << 'shoes-swt'
14
- @packager = Furoshiki::JarApp.new(config)
15
- end
16
- end
17
- end
18
- end