Skip to content

Conversation

Nazz78
Copy link

@Nazz78 Nazz78 commented Aug 6, 2018

Added proper ColumnType::Base according to updated DBF library? Works for me.

Nazz78 added 2 commits August 6, 2018 23:38
This fixes the problem with wrong encoding when dbf file is read and encoding is not specified. We eg. use UTF-8, which gives correct results  instead of some strange characters when non-ascii characters are used.
end

@dbf = Dbf::Reader.open(@file_root + '.dbf')
@dbf = Dbf::Reader.open(@file_root + '.dbf', nil, dbf_encoding)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

# Open DBF with specified encoding (it can also be nil and DBF reader
# will use what it finds in header).
def self.open(f, memo = nil, encoding)
new(f, memo, encoding)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/IndentationWidth: Use 2 (not 8) spaces for indentation.

new(f)
# Open DBF with specified encoding (it can also be nil and DBF reader
# will use what it finds in header).
def self.open(f, memo = nil, encoding)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/Tab: Tab detected.
Layout/IndentationConsistency: Inconsistent indentation detected.
Naming/UncommunicativeMethodParamName: Method parameter must be at least 3 characters long.

def self.open(f)
new(f)
# Open DBF with specified encoding (it can also be nil and DBF reader
# will use what it finds in header).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/Tab: Tab detected.


def self.open(f)
new(f)
# Open DBF with specified encoding (it can also be nil and DBF reader
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Layout/Tab: Tab detected.

@kueda
Copy link
Contributor

kueda commented Oct 3, 2018

Do the specs pass for you, @Nazz78? I get a lot of failures, e.g.

  7) GeoRuby::Shp4r Write test_creation_multipoint
     Failure/Error: super(name, type, length, decimal, version, enc)
     
     ArgumentError:
       wrong number of arguments (given 6, expected 2)
     # /path/to/ruby/gems/dbf-3.1.3/lib/dbf/column_type.rb:11:in `initialize'
     # ./lib/geo_ruby/shp4r/dbf.rb:25:in `initialize'
     # ./spec/geo_ruby/shp4r/shp_spec.rb:226:in `new'
     # ./spec/geo_ruby/shp4r/shp_spec.rb:226:in `block (3 levels) in <top (required)>'

@Nazz78
Copy link
Author

Nazz78 commented Oct 5, 2018

@kueda I don't know. Can you please provide me with some link on how to set the specs up?

@kueda
Copy link
Contributor

kueda commented Oct 5, 2018

For me I just ran bundle to make sure I had all the deps and then ran rake. You could also run rspec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants