fort 1.0.0 → 1.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.
@@ -1,6 +1,6 @@
1
1
  module Fort
2
2
  class Type
3
- class CharacterType < Type
3
+ class CharacterType < self
4
4
  require 'ruby_patch'
5
5
  extend ::RubyPatch::AutoLoad
6
6
 
@@ -1,22 +1,14 @@
1
1
  module Fort
2
2
  class Type
3
- class ComplexType < Type
3
+ class ComplexType < ::Fort::Type::NumericType
4
4
  require 'ruby_patch'
5
5
  extend ::RubyPatch::AutoLoad
6
6
 
7
- attr_reader :kind
7
+ attr_reader :kind, :kind_const
8
8
 
9
9
  def initialize(dim = 0, kind = 32)
10
- super(dim)
11
- @kind = kind
12
- end
13
-
14
- def to_s
15
- "#{super}Kind#{@kind}"
16
- end
17
-
18
- def declare
19
- "#{@stem}(REAL#{@kind})#{super}"
10
+ super
11
+ @kind_const = "REAL#{@kind}"
20
12
  end
21
13
  end
22
14
  end
@@ -1,22 +1,12 @@
1
1
  module Fort
2
2
  class Type
3
- class IntegerType < Type
3
+ class IntegerType < ::Fort::Type::NumericType
4
4
  require 'ruby_patch'
5
5
  extend ::RubyPatch::AutoLoad
6
6
 
7
- attr_reader :kind
8
-
9
7
  def initialize(dim = 0, kind = 32)
10
- super(dim)
11
- @kind = kind
12
- end
13
-
14
- def to_s
15
- "#{super}Kind#{@kind}"
16
- end
17
-
18
- def declare
19
- "#{@stem}(INT#{@kind})#{super}"
8
+ super
9
+ @kind_const = "INT#{@kind}"
20
10
  end
21
11
  end
22
12
  end
@@ -1,6 +1,6 @@
1
1
  module Fort
2
2
  class Type
3
- class LogicalType < Type
3
+ class LogicalType < self
4
4
  require 'ruby_patch'
5
5
  extend ::RubyPatch::AutoLoad
6
6
 
@@ -0,0 +1,24 @@
1
+ module Fort
2
+ class Type
3
+ class NumericType < ::Fort::Type
4
+ require 'ruby_patch'
5
+ extend ::RubyPatch::AutoLoad
6
+
7
+ attr_reader :kind, :kind_const
8
+
9
+ def initialize(dim = 0, kind = 32)
10
+ super(dim)
11
+ @kind = kind
12
+ @kind_const = nil
13
+ end
14
+
15
+ def to_s
16
+ "#{super}Kind#{@kind}"
17
+ end
18
+
19
+ def declare
20
+ "#{@stem}(#{@kind_const})#{super}"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,22 +1,14 @@
1
1
  module Fort
2
2
  class Type
3
- class RealType < Type
3
+ class RealType < ::Fort::Type::NumericType
4
4
  require 'ruby_patch'
5
5
  extend ::RubyPatch::AutoLoad
6
6
 
7
- attr_reader :kind
7
+ attr_reader :kind, :kind_const
8
8
 
9
9
  def initialize(dim = 0, kind = 32)
10
- super(dim)
11
- @kind = kind
12
- end
13
-
14
- def to_s
15
- "#{super}Kind#{@kind}"
16
- end
17
-
18
- def declare
19
- "#{@stem}(REAL#{@kind})#{super}"
10
+ super
11
+ @kind_const = "REAL#{@kind}"
20
12
  end
21
13
  end
22
14
  end
data/lib/fort/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Fort
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fort
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-10 00:00:00.000000000 Z
12
+ date: 2012-08-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby_patch
16
- requirement: &69729240 !ruby/object:Gem::Requirement
16
+ requirement: &69161810 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *69729240
24
+ version_requirements: *69161810
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: pry
27
- requirement: &69726510 !ruby/object:Gem::Requirement
27
+ requirement: &69176500 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0.9'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *69726510
35
+ version_requirements: *69176500
36
36
  description: Ruby library for Fortran 90 and newer.
37
37
  email:
38
38
  executables: []
@@ -50,6 +50,7 @@ files:
50
50
  - lib/fort/type/complex_type.rb
51
51
  - lib/fort/type/integer_type.rb
52
52
  - lib/fort/type/logical_type.rb
53
+ - lib/fort/type/numeric_type.rb
53
54
  - lib/fort/type/real_type.rb
54
55
  - lib/fort/version.rb
55
56
  - rakefile