citero-jruby 1.2.0 → 2.1.0
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.
- data/lib/citero-jruby/CSF.rb +4 -3
- data/lib/citero-jruby/base.rb +7 -1
- data/lib/citero-jruby/citero.jar +0 -0
- data/lib/citero-jruby/core_ext.rb +12 -0
- data/lib/citero-jruby/version.rb +1 -1
- metadata +3 -2
data/lib/citero-jruby/CSF.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'citero-jruby/core_ext'
|
1
2
|
module Citero
|
2
3
|
|
3
4
|
# Java is required in this module.
|
@@ -23,7 +24,7 @@ module Citero
|
|
23
24
|
#Defines the method and caches it to the class
|
24
25
|
self.class.send(:define_method, meth) do
|
25
26
|
# Splits the method and parameter. See formatize and directionize
|
26
|
-
@csf::config()::getStringArray(meth.to_s).to_a
|
27
|
+
@csf::config()::getStringArray(meth.to_s.to_java_name).to_a
|
27
28
|
end
|
28
29
|
# calls the method
|
29
30
|
send meth, *args, &block
|
@@ -44,13 +45,13 @@ module Citero
|
|
44
45
|
# Private method. Checks to see if the method name is a valid key
|
45
46
|
# for the configuration file.
|
46
47
|
def matches? meth
|
47
|
-
@csf::config()::containsKey(meth.to_s)
|
48
|
+
@csf::config()::containsKey(meth.to_s.to_java_name)
|
48
49
|
end
|
49
50
|
private :matches?
|
50
51
|
|
51
52
|
# A list of keys that is available in this properties configuration
|
52
53
|
def keys
|
53
|
-
@keys ||= Array.new(@csf::config()::getKeys.collect {|key| key})
|
54
|
+
@keys ||= Array.new(@csf::config()::getKeys.collect {|key| key.to_ruby_name})
|
54
55
|
end
|
55
56
|
end
|
56
57
|
end
|
data/lib/citero-jruby/base.rb
CHANGED
@@ -4,6 +4,7 @@ module Citero
|
|
4
4
|
|
5
5
|
# Import of an important java enum type
|
6
6
|
java_import Java::EduNyuLibraryCitero::Formats
|
7
|
+
java_import Java::EduNyuLibraryCitero::CitationStyles
|
7
8
|
|
8
9
|
# Calling the map method creates a new instance of the Base class, with splatter operator passed in
|
9
10
|
def self.map *args
|
@@ -20,6 +21,11 @@ module Citero
|
|
20
21
|
@from_formats ||= formats :isSourceFormat
|
21
22
|
end
|
22
23
|
|
24
|
+
# List of available Citation Styles Citero can exports to as a module class method for quick checks.
|
25
|
+
def self.citation_styles
|
26
|
+
@citation_styles ||= CitationStyles::values.collect {|style| style.name.downcase}
|
27
|
+
end
|
28
|
+
|
23
29
|
private
|
24
30
|
def self.formats meth
|
25
31
|
Formats::values.select {|format| format.send(meth) }.collect {|format| format.name.downcase}
|
@@ -111,7 +117,7 @@ module Citero
|
|
111
117
|
# that can accept the formats, and checks to see if the formats are in a list
|
112
118
|
# of formats as defined by the Java enum Format.
|
113
119
|
def matches? meth
|
114
|
-
directions.include?
|
120
|
+
directions.include?(directionize(meth)) && (method("#{directionize(meth)}_formats").call.include?(formatize(meth)) || Citero.citation_styles.include?(formatize(meth)))
|
115
121
|
end
|
116
122
|
private :matches?
|
117
123
|
|
data/lib/citero-jruby/citero.jar
CHANGED
Binary file
|
data/lib/citero-jruby/version.rb
CHANGED
metadata
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
name: citero-jruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 2.1.0
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- hab278
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/citero-jruby.rb
|
151
151
|
- lib/citero-jruby/base.rb
|
152
152
|
- lib/citero-jruby/citero.jar
|
153
|
+
- lib/citero-jruby/core_ext.rb
|
153
154
|
- lib/citero-jruby/CSF.rb
|
154
155
|
- lib/citero-jruby/version.rb
|
155
156
|
- Rakefile
|