asposeslides 0.0.3 → 0.0.4

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: f52e417702c4ccaf1bd7c833eebafbccabab1201
4
- data.tar.gz: e91f142a87d68227ba3900fae3f8d688cc2f00f6
3
+ metadata.gz: 4a68a0f371d9b110424e62b4770c80d4b548d361
4
+ data.tar.gz: 674e3a933d843164d3529b1c0298761dd0d3b58f
5
5
  SHA512:
6
- metadata.gz: 7c771922708de44ada8f668b3563e7dde9b5bcf378dbb10ead7370a08418e017e546ded0283f4099c38a6be7725fdf6f5b74968a4604387cd814155fcf8e50bc
7
- data.tar.gz: bd987278fea6049a67ed0f9fd06f117ac00df2b313ad72bc95d5d734c408cf7626a3c35a717676f680d2e7f6104e7d9d74c784558b5da91a7b7c2318bd84b34c
6
+ metadata.gz: eab0be962c10194a1bf07c50721418fc46d953c4956ff1234acd859578982ffa21de4e67dddf55eacb8deb88ebcc24dd38ca5568d0ed2a17254a2b3c40316b6e
7
+ data.tar.gz: bd32e660b486c355bba605ebb1e4beda1ecfdca622bf34dc50d6e8da21d3998185d961c38fce918078f7aa4246dce16af8e81e893f562042ec40b045ac8fe9e0
data/README.md CHANGED
@@ -20,14 +20,16 @@ Or install it yourself as:
20
20
 
21
21
  ## Usage : Rails app
22
22
 
23
- * Create a file aspose.yml under app/config folder. This file specifies the path to your aspose slides for Java path. Put the following lines in that file:
23
+ * Create a file aspose.yml under app/config folder. This file specifies the path to your aspose slides for Java path, the license path and the jvm args if any. Put the following lines in that file:
24
24
  ```yaml
25
25
  development:
26
26
  jar_dir: /path/to/your/asposeslides/jars/directory
27
27
  license_path: /path/to/your/asposeslides/license/path
28
+ jvm_args: -Xms512m -Xmx1G
28
29
  test:
29
30
  jar_dir: /path/to/your/asposeslides/jars/directory
30
31
  license_path: /path/to/your/asposeslides/license/path
32
+ jvm_args: -Xms512m -Xmx1G
31
33
  ```
32
34
  * Next you need to initialize the aspose library. Aspose is a paid library and therefor you need to buy the appropriate license and provide the path to the licensed java library to initialize the gem.
33
35
  * Create a file called aspose.rb under the initializer app/config/initializers folder. Put the following lines in the file
@@ -1,2 +1,3 @@
1
1
  jar_dir: ../asposeslides/jars
2
2
  license_path: /path/to/your/asposeslides/license/path
3
+ jvm_args: -Xms512m -Xmx1G
@@ -12,8 +12,9 @@ module Asposeslides
12
12
  def initialize_aspose
13
13
  aspose_jars_dir = Asposeslides.aspose_slides_config ? Asposeslides.aspose_slides_config['jar_dir'] : nil
14
14
  aspose_license_path = Asposeslides.aspose_slides_config ? Asposeslides.aspose_slides_config['license_path'] : nil
15
+ jvm_args = Asposeslides.aspose_slides_config ? Asposeslides.aspose_slides_config['jvm_args'] : nil
15
16
 
16
- load_aspose_jars(aspose_jars_dir)
17
+ load_aspose_jars(aspose_jars_dir, jvm_args)
17
18
  load_aspose_license(aspose_license_path)
18
19
  end
19
20
 
@@ -27,13 +28,23 @@ module Asposeslides
27
28
  end
28
29
  end
29
30
 
30
- def load_aspose_jars(aspose_jars_dir)
31
+ def load_aspose_jars(aspose_jars_dir, jvm_args)
31
32
  if aspose_jars_dir && File.exist?(aspose_jars_dir)
32
33
  jardir = File.join(aspose_jars_dir, '**', '*.jar')
33
34
  else
34
35
  jardir = File.join(File.dirname(File.dirname(__FILE__)), 'jars', '**', '*.jar')
35
36
  end
36
- Rjb::load(classpath = Dir.glob(jardir).join(':'), jvmargs=['-Djava.awt.headless=true'])
37
+
38
+ if jvm_args
39
+ args = jvm_args.split(' ') << '-Djava.awt.headless=true'
40
+ logger = Logger.new(STDOUT)
41
+ logger.level = Logger::DEBUG
42
+ logger.debug("JVM args : #{args}")
43
+ Rjb::load(classpath = Dir.glob(jardir).join(':'), jvmargs=args)
44
+ else
45
+ Rjb::load(classpath = Dir.glob(jardir).join(':'), jvmargs=['-Djava.awt.headless=true'])
46
+ end
47
+
37
48
  end
38
49
 
39
50
  def input_file(file)
@@ -1,3 +1,3 @@
1
1
  module Asposeslides
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asposeslides
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sanjeev Mishra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-12 00:00:00.000000000 Z
11
+ date: 2015-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler