mysql_isolated_server 0.4.1 → 0.5.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.
- checksums.yaml +4 -4
- data/lib/mysql_isolated_server.rb +9 -4
- data/lib/mysql_isolated_server/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f9acbc0a32698fe44576124a013b2b4ec48f2e51
         | 
| 4 | 
            +
              data.tar.gz: 912fbacd2e4889ca24a4d741cbece22eb9c26d33
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d62d19dee9fdb8e18542e451fcbd3bfea8681c1cdf2b42092494392ccdfc3003bf66ccdfd3b36d1ef7652d217d9cb4676a1279da19982c4f414820c0c638d74f
         | 
| 7 | 
            +
              data.tar.gz: a27123fa090336202e5949f08151ba72c96cf2a1a3ecd471aa91bfb7d923758e3e9c0755943925824e6edcc0c6e52e01051254f8d5fb97f52bdf0ad321d39f67
         | 
| @@ -9,7 +9,7 @@ end | |
| 9 9 |  | 
| 10 10 | 
             
            class MysqlIsolatedServer
         | 
| 11 11 | 
             
              include DBConnection
         | 
| 12 | 
            -
              attr_reader :pid, :base, :port
         | 
| 12 | 
            +
              attr_reader :pid, :base, :port, :initial_binlog_file, :initial_binlog_pos
         | 
| 13 13 | 
             
              attr_accessor :params
         | 
| 14 14 | 
             
              MYSQL_BASE_DIR="/usr"
         | 
| 15 15 |  | 
| @@ -56,13 +56,15 @@ class MysqlIsolatedServer | |
| 56 56 | 
             
              end
         | 
| 57 57 |  | 
| 58 58 | 
             
              def make_slave_of(master)
         | 
| 59 | 
            -
                 | 
| 59 | 
            +
                binlog_file = master.initial_binlog_file || (@log_bin.split('/').last + ".000001")
         | 
| 60 | 
            +
                binlog_pos = master.initial_binlog_pos || 106
         | 
| 61 | 
            +
             | 
| 60 62 | 
             
                connection.query(<<-EOL
         | 
| 61 63 | 
             
                  change master to master_host='127.0.0.1',
         | 
| 62 64 | 
             
                                   master_port=#{master.port},
         | 
| 63 65 | 
             
                                   master_user='root', master_password='',
         | 
| 64 | 
            -
                                   master_log_file='#{ | 
| 65 | 
            -
                                   master_log_pos=#{ | 
| 66 | 
            +
                                   master_log_file='#{binlog_file}',
         | 
| 67 | 
            +
                                   master_log_pos=#{binlog_pos}
         | 
| 66 68 | 
             
                  EOL
         | 
| 67 69 | 
             
                )
         | 
| 68 70 | 
             
                connection.query("SLAVE START")
         | 
| @@ -133,6 +135,9 @@ class MysqlIsolatedServer | |
| 133 135 |  | 
| 134 136 | 
             
                up!
         | 
| 135 137 |  | 
| 138 | 
            +
                master_binlog_info = connection.query("show master status").first
         | 
| 139 | 
            +
                @initial_binlog_file, @initial_binlog_pos = master_binlog_info.values_at('File', 'Position')
         | 
| 140 | 
            +
             | 
| 136 141 | 
             
                tzinfo_to_sql = locate_executable("mysql_tzinfo_to_sql5", "mysql_tzinfo_to_sql")
         | 
| 137 142 | 
             
                raise "could not find mysql_tzinfo_to_sql" unless tzinfo_to_sql
         | 
| 138 143 | 
             
                system("#{tzinfo_to_sql} /usr/share/zoneinfo 2>/dev/null| mysql -h127.0.0.1 --database=mysql --port=#{@port} -u root mysql ")
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: mysql_isolated_server
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 0.5.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Ben Osheroff
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2014- | 
| 11 | 
            +
            date: 2014-08-06 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies: []
         | 
| 13 13 | 
             
            description: A small library that allows you to easily spin up new local mysql servers
         | 
| 14 14 | 
             
              for testing purposes.
         |