syclink 0.1.2 → 0.1.3

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -5
  3. data/bin/syclink +17 -5
  4. data/doc/Gemfile.html +40 -0
  5. data/doc/Gemfile_lock.html +40 -0
  6. data/doc/LICENSE.html +40 -0
  7. data/doc/Object.html +3 -3
  8. data/doc/README_md.html +63 -11
  9. data/doc/README_rdoc.html +40 -0
  10. data/doc/Rakefile.html +40 -0
  11. data/doc/SycLink/Chrome.html +3 -0
  12. data/doc/SycLink/Designer.html +48 -8
  13. data/doc/SycLink/Exporter.html +2 -0
  14. data/doc/SycLink/FileImporter.html +2 -2
  15. data/doc/SycLink/Firefox.html +3 -0
  16. data/doc/SycLink/Formatter.html +2 -0
  17. data/doc/SycLink/Importer.html +57 -6
  18. data/doc/SycLink/Infrastructure.html +2 -0
  19. data/doc/SycLink/InternetExplorer.html +4 -2
  20. data/doc/SycLink/Link.html +2 -0
  21. data/doc/SycLink/LinkChecker.html +6 -4
  22. data/doc/SycLink/Website.html +5 -0
  23. data/doc/SycLink.html +28 -0
  24. data/doc/created.rid +58 -10
  25. data/doc/index.html +40 -0
  26. data/doc/js/navigation.js.gz +0 -0
  27. data/doc/js/search_index.js +1 -1
  28. data/doc/js/search_index.js.gz +0 -0
  29. data/doc/js/searcher.js.gz +0 -0
  30. data/doc/setup_md.html +40 -0
  31. data/doc/spec/syclink/fi/a_txt.html +40 -0
  32. data/doc/spec/syclink/fi/c/ie_url.html +40 -0
  33. data/doc/spec/syclink/gc/Bookmarks.html +40 -0
  34. data/doc/spec/syclink/ie/ie_url.html +40 -0
  35. data/doc/spec/syclink/ie/one/ie_url.html +40 -0
  36. data/doc/spec/syclink/ie/one/two/ie_url.html +40 -0
  37. data/doc/syclink_gemspec.html +40 -0
  38. data/doc/syclink_rdoc.html +40 -0
  39. data/doc/table_of_contents.html +118 -0
  40. data/doc/templates/example_html.html +40 -0
  41. data/doc/templates/links.html +40 -0
  42. data/doc/templates/stylesheets/style_css.html +40 -0
  43. data/doc/templates/stylesheets/style_css_map.html +40 -0
  44. data/doc/templates/stylesheets/style_css_scss.html +40 -0
  45. data/doc/templates/syc-link_html.html +40 -0
  46. data/lib/syclink/designer.rb +8 -0
  47. data/lib/syclink/file_importer.rb +2 -2
  48. data/lib/syclink/importer.rb +8 -1
  49. data/lib/syclink/internet_explorer.rb +2 -2
  50. data/lib/syclink/link_checker.rb +2 -0
  51. data/lib/syclink/version.rb +1 -1
  52. data/spec/syclink/designer_spec.rb +23 -0
  53. metadata +2 -2
@@ -70,6 +70,46 @@
70
70
 
71
71
  <li><a href="../Rakefile.html">Rakefile</a>
72
72
 
73
+ <li><a href="../pkg/syclink-0_1_2/Gemfile.html">Gemfile</a>
74
+
75
+ <li><a href="../pkg/syclink-0_1_2/Gemfile_lock.html">Gemfile.lock</a>
76
+
77
+ <li><a href="../pkg/syclink-0_1_2/LICENSE.html">LICENSE</a>
78
+
79
+ <li><a href="../pkg/syclink-0_1_2/README_md.html">README</a>
80
+
81
+ <li><a href="../pkg/syclink-0_1_2/README_rdoc.html">README</a>
82
+
83
+ <li><a href="../pkg/syclink-0_1_2/Rakefile.html">Rakefile</a>
84
+
85
+ <li><a href="../pkg/syclink-0_1_2/setup_md.html">setup</a>
86
+
87
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/fi/a_txt.html">a</a>
88
+
89
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/fi/c/ie_url.html">ie.url</a>
90
+
91
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/gc/Bookmarks.html">Bookmarks</a>
92
+
93
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/ie/ie_url.html">ie.url</a>
94
+
95
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/ie/one/ie_url.html">ie.url</a>
96
+
97
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/ie/one/two/ie_url.html">ie.url</a>
98
+
99
+ <li><a href="../pkg/syclink-0_1_2/syclink_gemspec.html">syclink.gemspec</a>
100
+
101
+ <li><a href="../pkg/syclink-0_1_2/syclink_rdoc.html">syclink</a>
102
+
103
+ <li><a href="../pkg/syclink-0_1_2/templates/links.html">links</a>
104
+
105
+ <li><a href="../pkg/syclink-0_1_2/templates/stylesheets/style_css.html">style.css</a>
106
+
107
+ <li><a href="../pkg/syclink-0_1_2/templates/stylesheets/style_css_map.html">style.css.map</a>
108
+
109
+ <li><a href="../pkg/syclink-0_1_2/templates/stylesheets/style_css_scss.html">style.css.scss</a>
110
+
111
+ <li><a href="../pkg/syclink-0_1_2/templates/syc-link_html.html">syc-link.html</a>
112
+
73
113
  <li><a href="../setup_md.html">setup</a>
74
114
 
75
115
  <li><a href="../spec/syclink/fi/a_txt.html">a</a>
@@ -70,6 +70,46 @@
70
70
 
71
71
  <li><a href="../../Rakefile.html">Rakefile</a>
72
72
 
73
+ <li><a href="../../pkg/syclink-0_1_2/Gemfile.html">Gemfile</a>
74
+
75
+ <li><a href="../../pkg/syclink-0_1_2/Gemfile_lock.html">Gemfile.lock</a>
76
+
77
+ <li><a href="../../pkg/syclink-0_1_2/LICENSE.html">LICENSE</a>
78
+
79
+ <li><a href="../../pkg/syclink-0_1_2/README_md.html">README</a>
80
+
81
+ <li><a href="../../pkg/syclink-0_1_2/README_rdoc.html">README</a>
82
+
83
+ <li><a href="../../pkg/syclink-0_1_2/Rakefile.html">Rakefile</a>
84
+
85
+ <li><a href="../../pkg/syclink-0_1_2/setup_md.html">setup</a>
86
+
87
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/fi/a_txt.html">a</a>
88
+
89
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/fi/c/ie_url.html">ie.url</a>
90
+
91
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/gc/Bookmarks.html">Bookmarks</a>
92
+
93
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/ie_url.html">ie.url</a>
94
+
95
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/one/ie_url.html">ie.url</a>
96
+
97
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/one/two/ie_url.html">ie.url</a>
98
+
99
+ <li><a href="../../pkg/syclink-0_1_2/syclink_gemspec.html">syclink.gemspec</a>
100
+
101
+ <li><a href="../../pkg/syclink-0_1_2/syclink_rdoc.html">syclink</a>
102
+
103
+ <li><a href="../../pkg/syclink-0_1_2/templates/links.html">links</a>
104
+
105
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css.html">style.css</a>
106
+
107
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css_map.html">style.css.map</a>
108
+
109
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css_scss.html">style.css.scss</a>
110
+
111
+ <li><a href="../../pkg/syclink-0_1_2/templates/syc-link_html.html">syc-link.html</a>
112
+
73
113
  <li><a href="../../setup_md.html">setup</a>
74
114
 
75
115
  <li><a href="../../spec/syclink/fi/a_txt.html">a</a>
@@ -70,6 +70,46 @@
70
70
 
71
71
  <li><a href="../../Rakefile.html">Rakefile</a>
72
72
 
73
+ <li><a href="../../pkg/syclink-0_1_2/Gemfile.html">Gemfile</a>
74
+
75
+ <li><a href="../../pkg/syclink-0_1_2/Gemfile_lock.html">Gemfile.lock</a>
76
+
77
+ <li><a href="../../pkg/syclink-0_1_2/LICENSE.html">LICENSE</a>
78
+
79
+ <li><a href="../../pkg/syclink-0_1_2/README_md.html">README</a>
80
+
81
+ <li><a href="../../pkg/syclink-0_1_2/README_rdoc.html">README</a>
82
+
83
+ <li><a href="../../pkg/syclink-0_1_2/Rakefile.html">Rakefile</a>
84
+
85
+ <li><a href="../../pkg/syclink-0_1_2/setup_md.html">setup</a>
86
+
87
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/fi/a_txt.html">a</a>
88
+
89
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/fi/c/ie_url.html">ie.url</a>
90
+
91
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/gc/Bookmarks.html">Bookmarks</a>
92
+
93
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/ie_url.html">ie.url</a>
94
+
95
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/one/ie_url.html">ie.url</a>
96
+
97
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/one/two/ie_url.html">ie.url</a>
98
+
99
+ <li><a href="../../pkg/syclink-0_1_2/syclink_gemspec.html">syclink.gemspec</a>
100
+
101
+ <li><a href="../../pkg/syclink-0_1_2/syclink_rdoc.html">syclink</a>
102
+
103
+ <li><a href="../../pkg/syclink-0_1_2/templates/links.html">links</a>
104
+
105
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css.html">style.css</a>
106
+
107
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css_map.html">style.css.map</a>
108
+
109
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css_scss.html">style.css.scss</a>
110
+
111
+ <li><a href="../../pkg/syclink-0_1_2/templates/syc-link_html.html">syc-link.html</a>
112
+
73
113
  <li><a href="../../setup_md.html">setup</a>
74
114
 
75
115
  <li><a href="../../spec/syclink/fi/a_txt.html">a</a>
@@ -70,6 +70,46 @@
70
70
 
71
71
  <li><a href="../../Rakefile.html">Rakefile</a>
72
72
 
73
+ <li><a href="../../pkg/syclink-0_1_2/Gemfile.html">Gemfile</a>
74
+
75
+ <li><a href="../../pkg/syclink-0_1_2/Gemfile_lock.html">Gemfile.lock</a>
76
+
77
+ <li><a href="../../pkg/syclink-0_1_2/LICENSE.html">LICENSE</a>
78
+
79
+ <li><a href="../../pkg/syclink-0_1_2/README_md.html">README</a>
80
+
81
+ <li><a href="../../pkg/syclink-0_1_2/README_rdoc.html">README</a>
82
+
83
+ <li><a href="../../pkg/syclink-0_1_2/Rakefile.html">Rakefile</a>
84
+
85
+ <li><a href="../../pkg/syclink-0_1_2/setup_md.html">setup</a>
86
+
87
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/fi/a_txt.html">a</a>
88
+
89
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/fi/c/ie_url.html">ie.url</a>
90
+
91
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/gc/Bookmarks.html">Bookmarks</a>
92
+
93
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/ie_url.html">ie.url</a>
94
+
95
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/one/ie_url.html">ie.url</a>
96
+
97
+ <li><a href="../../pkg/syclink-0_1_2/spec/syclink/ie/one/two/ie_url.html">ie.url</a>
98
+
99
+ <li><a href="../../pkg/syclink-0_1_2/syclink_gemspec.html">syclink.gemspec</a>
100
+
101
+ <li><a href="../../pkg/syclink-0_1_2/syclink_rdoc.html">syclink</a>
102
+
103
+ <li><a href="../../pkg/syclink-0_1_2/templates/links.html">links</a>
104
+
105
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css.html">style.css</a>
106
+
107
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css_map.html">style.css.map</a>
108
+
109
+ <li><a href="../../pkg/syclink-0_1_2/templates/stylesheets/style_css_scss.html">style.css.scss</a>
110
+
111
+ <li><a href="../../pkg/syclink-0_1_2/templates/syc-link_html.html">syc-link.html</a>
112
+
73
113
  <li><a href="../../setup_md.html">setup</a>
74
114
 
75
115
  <li><a href="../../spec/syclink/fi/a_txt.html">a</a>
@@ -70,6 +70,46 @@
70
70
 
71
71
  <li><a href="../Rakefile.html">Rakefile</a>
72
72
 
73
+ <li><a href="../pkg/syclink-0_1_2/Gemfile.html">Gemfile</a>
74
+
75
+ <li><a href="../pkg/syclink-0_1_2/Gemfile_lock.html">Gemfile.lock</a>
76
+
77
+ <li><a href="../pkg/syclink-0_1_2/LICENSE.html">LICENSE</a>
78
+
79
+ <li><a href="../pkg/syclink-0_1_2/README_md.html">README</a>
80
+
81
+ <li><a href="../pkg/syclink-0_1_2/README_rdoc.html">README</a>
82
+
83
+ <li><a href="../pkg/syclink-0_1_2/Rakefile.html">Rakefile</a>
84
+
85
+ <li><a href="../pkg/syclink-0_1_2/setup_md.html">setup</a>
86
+
87
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/fi/a_txt.html">a</a>
88
+
89
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/fi/c/ie_url.html">ie.url</a>
90
+
91
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/gc/Bookmarks.html">Bookmarks</a>
92
+
93
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/ie/ie_url.html">ie.url</a>
94
+
95
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/ie/one/ie_url.html">ie.url</a>
96
+
97
+ <li><a href="../pkg/syclink-0_1_2/spec/syclink/ie/one/two/ie_url.html">ie.url</a>
98
+
99
+ <li><a href="../pkg/syclink-0_1_2/syclink_gemspec.html">syclink.gemspec</a>
100
+
101
+ <li><a href="../pkg/syclink-0_1_2/syclink_rdoc.html">syclink</a>
102
+
103
+ <li><a href="../pkg/syclink-0_1_2/templates/links.html">links</a>
104
+
105
+ <li><a href="../pkg/syclink-0_1_2/templates/stylesheets/style_css.html">style.css</a>
106
+
107
+ <li><a href="../pkg/syclink-0_1_2/templates/stylesheets/style_css_map.html">style.css.map</a>
108
+
109
+ <li><a href="../pkg/syclink-0_1_2/templates/stylesheets/style_css_scss.html">style.css.scss</a>
110
+
111
+ <li><a href="../pkg/syclink-0_1_2/templates/syc-link_html.html">syc-link.html</a>
112
+
73
113
  <li><a href="../setup_md.html">setup</a>
74
114
 
75
115
  <li><a href="../spec/syclink/fi/a_txt.html">a</a>
@@ -93,6 +93,7 @@ module SycLink
93
93
  website.find_links(url).first.update(args)
94
94
  end
95
95
 
96
+ # Updates links read from a file
96
97
  def update_links_from_file(file)
97
98
  File.foreach(file) do |line|
98
99
  next if line.chomp.empty?
@@ -116,6 +117,13 @@ module SycLink
116
117
  end
117
118
  end
118
119
 
120
+ # Deletes links based on URLs that are provided in a file. Each URL has to
121
+ # be in one line
122
+ def remove_links_from_file(file)
123
+ urls = File.foreach(file).map { |url| url.chomp unless url.empty? }
124
+ remove_links(urls)
125
+ end
126
+
119
127
  # Saves the website to the specified directory with the downcased name of
120
128
  # the website and the extension 'website'. The website is save as YAML
121
129
  def save_website(directory)
@@ -11,9 +11,9 @@ module SycLink
11
11
  begin
12
12
  [File.read(file).scan(/(?<=\nURL=)(.*)$/)
13
13
  .flatten.first.chomp,
14
- name = File.basename(file, ".*")]
14
+ url_name(File.basename(file, ".*"))]
15
15
  rescue
16
- [file, file.basename(file)]
16
+ [file, File.basename(file)]
17
17
  end
18
18
  else
19
19
  [file, File.basename(file)]
@@ -6,6 +6,8 @@ module SycLink
6
6
  # To be subclassed for link importers.
7
7
  class Importer
8
8
 
9
+ # REGEX to clean tags and url names
10
+ CLEANER = /[^a-zA-Zäöü& ]/
9
11
  # Path to bookmarks file
10
12
  attr_accessor :path
11
13
  # Options for importing
@@ -50,7 +52,7 @@ module SycLink
50
52
  opts[:tags].gsub!(',', '/') if opts[:tags]
51
53
  tags = (tag_string << opts[:tags]).compact
52
54
  .join('/')
53
- .gsub(/[^a-zA-Zäöu&#\/, ]/, " ")
55
+ .gsub(/[^a-zA-Zäöü&#\/, ]/, " ")
54
56
  .squeeze(" ")
55
57
  .split('/')
56
58
 
@@ -62,6 +64,11 @@ module SycLink
62
64
  end
63
65
 
64
66
  end
67
+
68
+ # Create a name from the url if no name is given.
69
+ def url_name(name_source)
70
+ name_source.gsub(CLEANER, " ").squeeze(" ")
71
+ end
65
72
  end
66
73
 
67
74
  end
@@ -14,8 +14,8 @@ module SycLink
14
14
 
15
15
  files.map do |file|
16
16
  unless ((File.directory? file) || (File.extname(file).upcase != ".URL"))
17
- url = File.read(file).scan(/(?<=\nURL=)(.*)$/).flatten.first
18
- name = File.basename(file, ".*")
17
+ url = File.read(file).scan(/(?<=\nURL=)(.*)$/).flatten.first.chomp
18
+ name = url_name(File.basename(file, ".*"))
19
19
  description = ""
20
20
  tag = extract_tags(File.dirname(file).scan(regex))
21
21
  [url, name, description, tag]
@@ -1,3 +1,5 @@
1
+ require 'uri'
2
+
1
3
  # Module that creates a link list and generates an html representation
2
4
  module SycLink
3
5
 
@@ -2,6 +2,6 @@
2
2
  module SycLink
3
3
 
4
4
  # Version of the application
5
- VERSION = '0.1.2'
5
+ VERSION = '0.1.3'
6
6
 
7
7
  end
@@ -109,6 +109,29 @@ module SycLink
109
109
  expect(@designer.list_links.size).to eq 1
110
110
  end
111
111
 
112
+ it "should delete links from a file" do
113
+ links = [ "http://example.com;Example;An example website;Test",
114
+ "http://test.de;test;A test website;Test",
115
+ "http://challenge.org;challenge;A challenge website;Challenge" ]
116
+ File.write("links.tmp", links.join("\n"))
117
+
118
+ @designer.add_links_from_file("links.tmp")
119
+ expect(@designer.website.links.size).to eq 3
120
+
121
+ links = [ "http://example.com",
122
+ "",
123
+ "http://challenge.org" ]
124
+ File.write("links.tmp", links.join("\n"))
125
+
126
+ @designer.remove_links_from_file("links.tmp")
127
+ expect(@designer.website.links.size).to eq 1
128
+ expect(@designer.website.links[0].name).to eq "test"
129
+ expect(@designer.website.links[0].tag).to eq "Test"
130
+ expect(@designer.website.links[0].description).to eq "A test website"
131
+
132
+ FileUtils.rm("links.tmp")
133
+ end
134
+
112
135
  it "should save, load and delete a website" do
113
136
  @designer.add_link("http://example.com",
114
137
  { tag: "Loader" })
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: syclink
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Sugar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-23 00:00:00.000000000 Z
11
+ date: 2015-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec