netlinx-src 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,82 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
- <head>
5
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6
- <title>
7
- File: README.md
8
-
9
- &mdash; Documentation by YARD 0.8.7.4
10
-
11
- </title>
12
-
13
- <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
-
15
- <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
-
17
- <script type="text/javascript" charset="utf-8">
18
- hasFrames = window.top.frames.main ? true : false;
19
- relpath = '';
20
- framesUrl = "frames.html#!file.README.md.html";
21
- </script>
22
-
23
-
24
- <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
-
26
- <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
-
28
-
29
- </head>
30
- <body>
31
- <div id="header">
32
- <div id="menu">
33
-
34
- <a href="_index.html">Index</a> &raquo;
35
- <span class="title">File: README.md</span>
36
-
37
-
38
- <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
39
- </div>
40
-
41
- <div id="search">
42
-
43
- <a class="full_list_link" id="class_list_link"
44
- href="class_list.html">
45
- Class List
46
- </a>
47
-
48
- <a class="full_list_link" id="method_list_link"
49
- href="method_list.html">
50
- Method List
51
- </a>
52
-
53
- <a class="full_list_link" id="file_list_link"
54
- href="file_list.html">
55
- File List
56
- </a>
57
-
58
- </div>
59
- <div class="clear"></div>
60
- </div>
61
-
62
- <iframe id="search_frame"></iframe>
63
-
64
- <div id="content"><div id='filecontents'>
65
- <p>&lt;&lt;&lt;&lt;&lt;&lt;&lt; local # NetLinx Source File Utility</p>
66
-
67
- <p>Package and unpackage NetLinx `.src` source code bundles.</p>
68
-
69
- <h6 id="label-"></h6>
70
-
71
- <p>&gt;&gt;&gt;&gt;&gt;&gt;&gt; other ## Documentation [<a
72
- href="https://sourceforge.net/p/netlinx-src/wiki/Home/](https://sourceforge.net/p/netlinx-src/wiki/Home">sourceforge.net/p/netlinx-src/wiki/Home/](https://sourceforge.net/p/netlinx-src/wiki/Home</a>/)</p>
73
- </div></div>
74
-
75
- <div id="footer">
76
- Generated on Wed May 7 18:13:49 2014 by
77
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
78
- 0.8.7.4 (ruby-2.1.1).
79
- </div>
80
-
81
- </body>
82
- </html>
data/lib/netlinx-src.rb DELETED
File without changes
@@ -1,59 +0,0 @@
1
- require 'zip'
2
-
3
- module NetLinx
4
- class ProjectPackage
5
-
6
- # Parameters:
7
- #
8
- # Mode:
9
- # :standard - Intelligently package all files pertaining to a
10
- # NetLinx project.
11
- #
12
- # :classic - Emulates the AMX file packager, including only .axs
13
- # and .axi files in the package. Also mimicks the same folder
14
- # structure.
15
- #
16
- def initialize **kvargs
17
- @file = kvargs.fetch :file, ''
18
- @mode = kvargs.fetch :mode, :standard
19
- @excluded_extensions = kvargs.fetch :excluded_extensions,
20
- [
21
- 'ai', 'bmp', 'eps', 'gz', 'jpg', 'jpeg', 'png', 'psd', 'src',
22
- 'svg', 'tar', 'zip'
23
- ]
24
- end
25
-
26
- # Pack the project into a NetLinx .src package.
27
- def pack
28
- File.delete @file if File.exists? @file
29
-
30
- files = Dir['**/*'] - Dir[@file]
31
-
32
- Zip::File.open @file, Zip::File::CREATE do |zip|
33
- files.each { |file| zip.add file, file }
34
- end
35
- end
36
-
37
- # Unpack a NetLinx .src project package.
38
- # Unpacks to the given directory, if provided.
39
- def unpack dir = nil
40
- Zip::File.open @file do |zip|
41
- zip.each_entry do |e|
42
- path = dir.nil? ? e.name : "#{dir}/#{e.name}"
43
- e.extract path
44
- end
45
- end
46
- end
47
-
48
- # Copy the NetLinx .src file to .zip for easy browsing without unpacking.
49
- def copy_to_zip
50
- FileUtils.cp @file, "#{@file}.zip"
51
- end
52
-
53
- # Remove the .zip version of this NetLinx .src file if it exists.
54
- def remove_zip
55
- File.delete "#{@file}.zip" if File.exists? "#{@file}.zip"
56
- end
57
-
58
- end
59
- end