node-sword-interface 0.252.0 → 0.254.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.
package/README.md CHANGED
@@ -101,7 +101,7 @@ These installation instructions are working on Debian/Ubuntu based Linux distrib
101
101
 
102
102
  To install the dependencies issue the following command on a Debian/Ubuntu based distribution:
103
103
 
104
- sudo apt-get install build-essential nodejs npm libcurl4-gnutls-dev libicu-dev pkg-config cmake
104
+ sudo apt-get install build-essential nodejs npm libcurl4-gnutls-dev libicu-dev zlib1g-dev pkg-config cmake subversion
105
105
 
106
106
  #### Install dependencies on macOS
107
107
 
package/binding.gyp CHANGED
@@ -70,7 +70,7 @@
70
70
  "src/napi_module/module_search_worker.cpp",
71
71
  "src/napi_module/napi_sword_helper.cpp",
72
72
  "src/napi_module/node_sword_interface.cpp",
73
- "src/napi_module/api_lock.cpp",
73
+ "src/napi_module/api_lock.cpp",
74
74
  "src/napi_module/binding.cpp"
75
75
  ],
76
76
  "conditions":[
@@ -113,10 +113,7 @@
113
113
  "libraries": [
114
114
  '<(module_root_dir)/sword_build/libsword.a',
115
115
  '<!@(pkg-config --libs libcurl)',
116
- '/usr/local/opt/icu4c/lib/libicudata.a',
117
- '/usr/local/opt/icu4c/lib/libicuuc.a',
118
- '/usr/local/opt/icu4c/lib/libicui18n.a',
119
- '/usr/local/opt/icu4c/lib/libicuio.a'
116
+ '<!@(PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig" pkg-config --libs icu-uc icu-io icu-i18n)'
120
117
  ],
121
118
  "dependencies": [
122
119
  "<!(node -p \"require('node-addon-api').gyp\")",
@@ -147,7 +144,7 @@
147
144
  ],
148
145
  'defines': [ 'SWUSINGDLL' ]
149
146
  }]
150
- ],
147
+ ],
151
148
  'dependencies': [
152
149
  "<!(node -p \"require('node-addon-api').gyp\")"
153
150
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-sword-interface",
3
- "version": "0.252.0",
3
+ "version": "0.254.0",
4
4
  "description": "Javascript (N-API) interface to SWORD library",
5
5
  "keywords": [
6
6
  "C++",
@@ -142,9 +142,9 @@ NodeSwordInterface::NodeSwordInterface(const Napi::CallbackInfo& info) : Napi::O
142
142
  Napi::Env env = info.Env();
143
143
  Napi::HandleScope scope(env);
144
144
 
145
- std::string customHomeDir = "";
146
145
  std::string localeDir = "";
147
- FileSystemHelper fsHelper;
146
+ this->customHomeDir = "";
147
+
148
148
  bool homeDirError = false;
149
149
  bool localeDirError = false;
150
150
 
@@ -153,9 +153,9 @@ NodeSwordInterface::NodeSwordInterface(const Napi::CallbackInfo& info) : Napi::O
153
153
  this->_currentModuleSearchWorker = 0;
154
154
 
155
155
  if (info[0].IsString()) {
156
- customHomeDir = string(info[0].As<Napi::String>());
156
+ this->customHomeDir = string(info[0].As<Napi::String>());
157
157
 
158
- if (!this->dirExists(info, customHomeDir)) {
158
+ if (!this->dirExists(info, this->customHomeDir)) {
159
159
  homeDirError = true;
160
160
  }
161
161
  }
@@ -171,10 +171,10 @@ NodeSwordInterface::NodeSwordInterface(const Napi::CallbackInfo& info) : Napi::O
171
171
  }
172
172
 
173
173
  if (!homeDirError && !localeDirError) { // We only proceed if there has not been any issue with the homeDir or localeDir
174
- this->_moduleStore = new ModuleStore(customHomeDir);
174
+ this->_moduleStore = new ModuleStore(this->customHomeDir);
175
175
  this->_moduleHelper = new ModuleHelper(*(this->_moduleStore));
176
- this->_repoInterface = new RepositoryInterface(this->_swordStatusReporter, *(this->_moduleHelper), customHomeDir);
177
- this->_moduleInstaller = new ModuleInstaller(*(this->_repoInterface), *(this->_moduleStore), customHomeDir);
176
+ this->_repoInterface = new RepositoryInterface(this->_swordStatusReporter, *(this->_moduleHelper), this->customHomeDir);
177
+ this->_moduleInstaller = new ModuleInstaller(*(this->_repoInterface), *(this->_moduleStore), this->customHomeDir);
178
178
  this->_napiSwordHelper = new NapiSwordHelper(*(this->_moduleHelper), *(this->_moduleStore));
179
179
  this->_textProcessor = new TextProcessor(*(this->_moduleStore), *(this->_moduleHelper));
180
180
  this->_moduleSearch = new ModuleSearch(*(this->_moduleStore), *(this->_moduleHelper), *(this->_textProcessor));
@@ -952,6 +952,10 @@ Napi::Value NodeSwordInterface::getSwordPath(const Napi::CallbackInfo& info)
952
952
  Napi::HandleScope scope(env);
953
953
 
954
954
  FileSystemHelper fsHelper;
955
+ if (this->customHomeDir != "") {
956
+ fsHelper.setCustomHomeDir(customHomeDir);
957
+ }
958
+
955
959
  Napi::String swordPath = Napi::String::New(env, fsHelper.getUserSwordDir());
956
960
  unlockApi();
957
961
  return swordPath;
@@ -112,6 +112,8 @@ private:
112
112
  SwordTranslationHelper* _swordTranslationHelper;
113
113
  SwordStatusReporter _swordStatusReporter;
114
114
  ModuleSearchWorker* _currentModuleSearchWorker;
115
+
116
+ std::string customHomeDir;
115
117
  };
116
118
 
117
119
  #endif // _NODE_SWORD_INTERFACE
@@ -214,13 +214,13 @@ int main(int argc, char** argv)
214
214
  //string translation = sword_facade.getSwordTranslation(string("/usr/share/sword/locales.d"), string("de"), string("locales"));
215
215
  //cout << translation << endl;
216
216
 
217
- vector<Verse> searchResults = moduleSearch.getModuleSearchResults("GerNeUe", "Glaube", SearchType::multiWord, SearchScope::NT, true);
217
+ /*vector<Verse> searchResults = moduleSearch.getModuleSearchResults("NASB", "faith", SearchType::multiWord, SearchScope::NT, true);
218
218
  cout << "Got " << searchResults.size() << " results!" << endl;
219
219
  for (unsigned int i=0; i < searchResults.size(); i++) {
220
220
  cout << searchResults[i].reference << endl;
221
- }
221
+ }*/
222
222
 
223
- /*get_book_headers(textProcessor);*/
223
+ get_book_headers(textProcessor);
224
224
 
225
225
  return 0;
226
226
  }